* dlopen.c (dlopen): Return NULL when name is NULL (suggested by

chrisiasci@aol.com).
* cygwin.din: Add a new, internally used export - _check_for_executable.
* dcrt0.cc (dll_crt0_1): Set _check_for_executable for older binaries.  Pass
user_data to premain functions.
* fhandler.cc (fhandler_disk_file::open): Only check for executable if the
linked program is intereested in the executable bit.
(fhandler_disk_file::check_execable_p): Delete.
* fhandler.h (executable_states): New enumeration of various states of
executable bit caring.
(fhandler_base::set_execable_p): New method.
* fhandler_termios.cc (fhandler_termios::line_edit): Flag when a signal has
been sent to the tty.  Return -1 when this is so.
* fhandler_console.cc (fhandler_console::read): Return -1 when signal sending
character encountered.
* path.cc (path_conv::check): Record when path refers to a disk device.  Move
executable extension check here.
(check_sysfile): Accomodate new EXEC path states.
(has_suffix): Remove.
(next_suffix): Remove.
(class suffix_scan): New clas.
(suffix_scan::has): New method.
(suffix_scan:next): New method.
(symlink_info::check): Use suffix_scan method to control for scanning for
suffixes.
* path.h (path_conv::exec_state): New method.
* perprocess.h: Make "C" friendly.
* include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_S_IEXEC.  Bump
CYGWIN_VERSION_API_MINOR.
* include/sys/cygwin.h: Change premain declarations.
* winsup.h: Move __cplusplus test to after builtin defines.
This commit is contained in:
Christopher Faylor
2001-03-05 06:28:25 +00:00
parent 658b5db941
commit 95a8465ba0
28 changed files with 315 additions and 147 deletions

View File

@@ -27,11 +27,11 @@ details. */
#include "child_info.h"
#define NEED_VFORK
#include "perthread.h"
#include "perprocess.h"
#include "path.h"
#include "dtable.h"
#include "shared_info.h"
#include "cygwin_version.h"
#include "perprocess.h"
#include "dll_init.h"
#include "host_dependent.h"
#include "security.h"
@@ -108,7 +108,11 @@ extern "C"
/* resourcelocks */ &_reslock, /* threadinterface */ &_mtinterf,
/* impure_ptr */ &reent_data,
};
BOOL ignore_case_with_glob = FALSE;
bool ignore_case_with_glob = FALSE;
int __declspec (dllexport) _check_for_executable = FALSE;
#ifdef DEBUGGING
int pinger = 0;
#endif
};
char *old_title = NULL;
@@ -752,6 +756,9 @@ dll_crt0_1 ()
longjmp (fork_info->jmp, fork_info->cygpid);
}
if (!CYGWIN_VERSION_CHECK_FOR_S_IEXEC)
_check_for_executable = TRUE;
#ifdef DEBUGGING
{
extern void fork_init ();
@@ -808,7 +815,7 @@ dll_crt0_1 ()
if (user_data->premain[0])
for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++)
user_data->premain[i] (__argc, __argv);
user_data->premain[i] (__argc, __argv, user_data);
/* Set up __progname for getopt error call. */
__progname = __argv[0];
@@ -832,7 +839,7 @@ dll_crt0_1 ()
/* Execute any specified "premain" functions */
if (user_data->premain[PREMAIN_LEN / 2])
for (unsigned int i = PREMAIN_LEN / 2; i < PREMAIN_LEN; i++)
user_data->premain[i] (__argc, __argv);
user_data->premain[i] (__argc, __argv, user_data);
debug_printf ("user_data->main %p", user_data->main);