OSDN Git Service

* dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely know to be
authorcgf <cgf>
Tue, 9 Sep 2003 03:11:31 +0000 (03:11 +0000)
committercgf <cgf>
Tue, 9 Sep 2003 03:11:31 +0000 (03:11 +0000)
set.
* exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since it is
reset automatically.
* fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP.
* include/sys/cygwin.h: Ditto.
* sigproc.cc (sig_send): Use sigframe init method to set frame since it checks
for previous ownership of the frame.
* sigproc.h (sigframe::init): Accept an "is_exception" argument.

winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fork.cc
winsup/cygwin/include/sys/cygwin.h
winsup/cygwin/sigproc.cc
winsup/cygwin/sigproc.h

index 815917e..478ca65 100644 (file)
@@ -1,5 +1,17 @@
 2003-09-08  Christopher Faylor  <cgf@redhat.com>
 
+       * dcrt0.cc (dlL_crt0_1): Set __argc_safe after __argc is absolutely
+       know to be set.
+       * exceptions.cc (sig_handle_tty_stop): Don't reset sigCONT event since
+       it is reset automatically.
+       * fork.cc (fork): Remove obsolete usage of PID_SPLIT_HEAP.
+       * include/sys/cygwin.h: Ditto.
+       * sigproc.cc (sig_send): Use sigframe init method to set frame since it
+       checks for previous ownership of the frame.
+       * sigproc.h (sigframe::init): Accept an "is_exception" argument.
+
+2003-09-08  Christopher Faylor  <cgf@redhat.com>
+
        * dir.cc (readdir): Reinstate setting of old ino field for legacy
        applications.
        * dirent.h (dirent): Rename unused field to __ino32.
index 635759b..d8141dd 100644 (file)
@@ -607,7 +607,7 @@ dll_crt0_1 ()
                                  DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
              h = NULL;
            set_myself (mypid, h);
-           __argc = __argc_safe = spawn_info->moreinfo->argc;
+           __argc = spawn_info->moreinfo->argc;
            __argv = spawn_info->moreinfo->argv;
            envp = spawn_info->moreinfo->envp;
            envc = spawn_info->moreinfo->envc;
@@ -724,6 +724,7 @@ dll_crt0_1 ()
        }
     }
 
+  __argc_safe = __argc;
   if (user_data->premain[0])
     for (unsigned int i = 0; i < PREMAIN_LEN / 2; i++)
       user_data->premain[i] (__argc, __argv, user_data);
index feffcd3..3a599f9 100644 (file)
@@ -618,7 +618,6 @@ sig_handle_tty_stop (int sig)
                  myself->pid, sig, myself->ppid_handle);
   if (WaitForSingleObject (sigCONT, INFINITE) != WAIT_OBJECT_0)
     api_fatal ("WaitSingleObject failed, %E");
-  (void) ResetEvent (sigCONT);
   return;
 }
 }
@@ -1048,23 +1047,23 @@ sig_handle (int sig)
 
   goto dosig;
 
- stop:
+stop:
   /* Eat multiple attempts to STOP */
   if (ISSTATE (myself, PID_STOPPED))
     goto done;
   handler = (void *) sig_handle_tty_stop;
   thissig = myself->getsig (SIGSTOP);
 
- dosig:
+dosig:
   /* Dispatch to the appropriate function. */
   sigproc_printf ("signal %d, about to call %p", sig, handler);
   rc = setup_handler (sig, handler, thissig);
 
- done:
+done:
   sigproc_printf ("returning %d", rc);
   return rc;
 
- exit_sig:
+exit_sig:
   if (sig == SIGQUIT || sig == SIGABRT)
     {
       CONTEXT c;
index 27f85db..8ec84d6 100644 (file)
@@ -510,7 +510,7 @@ err:
   buflen = (size_t) -1;
   return;
 
- sig_exit:
+sig_exit:
   set_sig_errno (EINTR);
   buflen = (size_t) -1;
   return;
index 021b832..f948209 100644 (file)
@@ -633,15 +633,6 @@ fork ()
   grouped.hParent = grouped.first_dll = NULL;
   grouped.load_dlls = 0;
 
-  if (ISSTATE(myself, PID_SPLIT_HEAP))
-    {
-      system_printf ("The heap has been split, CYGWIN can't fork this process.");
-      system_printf ("Increase the heap_chunk_size in the registry and try again.");
-      set_errno (ENOMEM);
-      syscall_printf ("-1 = fork (), split heap");
-      return -1;
-    }
-
   void *esp;
   __asm__ volatile ("movl %%esp,%0": "=r" (esp));
 
index e117175..9dd46db 100644 (file)
@@ -89,8 +89,7 @@ enum
   PID_ORPHANED        = 0x0020, /* Member of an orphaned process group. */
   PID_ACTIVE          = 0x0040, /* Pid accepts signals. */
   PID_CYGPARENT               = 0x0080, /* Set if parent was a cygwin app. */
-  PID_SPLIT_HEAP       = 0x0100, /* Set if the heap has been split, */
-                                /*  which means we can't fork again. */
+  PID_UNUSED          = 0x0100, /* ... */
   PID_MYSELF          = 0x0200, /* Flag that pid is me. */
   PID_NOCLDSTOP               = 0x0400, /* Set if no SIGCHLD signal on stop. */
   PID_INITIALIZING     = 0x0800, /* Set until ready to receive signals. */
index ce7c388..795c7f3 100644 (file)
@@ -717,7 +717,7 @@ sig_send (_pinfo *p, int sig, DWORD ebp, bool exception)
        {
          thiscatch = sigcatch_main;
          thiscomplete = sigcomplete_main;
-         thisframe.set (mainthread, ebp, exception);
+         thisframe.init (mainthread, ebp, exception);
          todo = getlocal_sigtodo (sig);
          issem = true;
        }
index 360ae8b..35ad890 100644 (file)
@@ -75,10 +75,10 @@ public:
     if (!oframe)
       t.get_winapi_lock ();
   }
-  inline void init (sigthread &t, DWORD ebp = (DWORD) __builtin_frame_address (0))
+  inline void init (sigthread &t, DWORD ebp = (DWORD) __builtin_frame_address (0), bool is_exception = 0)
   {
-    if (!t.frame && t.id == GetCurrentThreadId ())
-      set (t, ebp);
+    if (is_exception || (!t.frame && t.id == GetCurrentThreadId ()))
+      set (t, ebp, is_exception);
     else
       st = NULL;
   }