Throughout, eliminate third argument to path_conv and use new PC_* constants

for second argument.
* path.h: Generalize SYMLINK_* constants to PC_*.
(path_conv): Create a new method.  Fold third argument into second.
* dll_init.cc (dll_list::alloc): Try harder to find space to allocate dll
struct.
(dll_dllcrt0): Don't check sanity if we've already called dll_crt0.
* path.cc (path_conv::check): Don't check for a null or empty path unless
specifically told with a flag setting.
(check_null_empty_path): New function, adapted from macro.
* syscalls.cc (_rename): Use already-determined file attributes rather than
checking again.
* lib/cygwin/cygwin_attach.dll.c (cygwin_attach_dll): Use a static per_process
structure since this is apparently supposed to be zeroed.
* lib/cygwin_crt0.c (cygwin_crt0): Zero per_process structure sent to older
DLLs.
This commit is contained in:
Christopher Faylor
2000-07-17 19:18:21 +00:00
parent 17811f7bbe
commit 5bc584ba65
15 changed files with 147 additions and 99 deletions

View File

@@ -735,26 +735,19 @@ dll_crt0_1 ()
/* Initialize uid, gid. */
uinfo_init ();
/* beyond this we only do for cygwin apps or dlls */
if (dynamically_loaded)
{
cygwin_finished_initializing = 1;
return;
}
/* Initialize signal/subprocess handling. */
sigproc_init ();
/* Connect to tty. */
tty_init ();
/* Set up standard fds in file descriptor table. */
hinfo_init ();
if (user_data->premain[0])
for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++)
user_data->premain[i] (argc, argv);
/* Set up standard fds in file descriptor table. */
hinfo_init ();
/* Scan the command line and build argv. Expand wildcards if not
called from another cygwin process. */
build_argv (line, argv, argc,
@@ -772,11 +765,6 @@ dll_crt0_1 ()
/* Set up __progname for getopt error call. */
__progname = argv[0];
/* Flush signals and ensure that signal thread is up and running. Can't
do this for noncygwin case since the signal thread is blocked due to
LoadLibrary serialization. */
sig_send (NULL, __SIGFLUSH);
cygwin_finished_initializing = 1;
/* Call init of loaded dlls. */
dlls.init ();
@@ -788,6 +776,17 @@ dll_crt0_1 ()
debug_printf ("user_data->main %p", user_data->main);
if (dynamically_loaded)
{
set_errno (0);
return;
}
/* Flush signals and ensure that signal thread is up and running. Can't
do this for noncygwin case since the signal thread is blocked due to
LoadLibrary serialization. */
sig_send (NULL, __SIGFLUSH);
set_errno (0);
if (user_data->main)