summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-07-17 19:18:21 +0000
committerChristopher Faylor <me@cgf.cx>2000-07-17 19:18:21 +0000
commit5bc584ba65db809b22dd2e10eb2cef922ca60d26 (patch)
tree8248ba57d925f599c0d3fbfb7a7ba6bf8273350a /winsup/cygwin/dcrt0.cc
parent17811f7bbe8480acfb8b6ef7ad8dcfa5f2819515 (diff)
downloadcygnal-5bc584ba65db809b22dd2e10eb2cef922ca60d26.tar.gz
cygnal-5bc584ba65db809b22dd2e10eb2cef922ca60d26.tar.bz2
cygnal-5bc584ba65db809b22dd2e10eb2cef922ca60d26.zip
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.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc29
1 files changed, 14 insertions, 15 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 0b6c7012d..283c2f3f4 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -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)