Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-09-26 07:20:30 +0400
committerChristopher Faylor <me@cgf.cx>2003-09-26 07:20:30 +0400
commit6c68fbbc61b58863debe39c97f71a9d06ecc87f5 (patch)
tree81c795b768639df9399ac6011262c73f2af87132 /winsup/cygwin
parent177989407a3d1775148e1b56a54ad656f05d5004 (diff)
* fork.cc (fork_parent): Detect failed pinfo constructor.
* spawn.cc (spawn_guts): Don't overwrite ENOMEM errno on failed pinfo constructor.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/fork.cc7
-rw-r--r--winsup/cygwin/spawn.cc3
3 files changed, 15 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 927147cf9..f28edfa0e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2003-09-25 Christopher Faylor <cgf@redhat.com>
+ * fork.cc (fork_parent): Detect failed pinfo constructor.
+ * spawn.cc (spawn_guts): Don't overwrite ENOMEM errno on failed pinfo
+ constructor.
+
+2003-09-25 Christopher Faylor <cgf@redhat.com>
+
* spawn.cc (spawnve): Remove vfork short circuit and let caller deal
with error return.
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 2fe73667a..00f296bae 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -500,6 +500,13 @@ fork_parent (HANDLE& hParent, dll *&first_dll,
#else
pinfo forked (cygwin_pid (pi.dwProcessId), 1);
#endif
+ if (!forked)
+ {
+ syscall_printf ("pinfo failed");
+ if (get_errno () != ENOMEM)
+ set_errno (EAGAIN);
+ goto cleanup;
+ }
/* Initialize things that are done later in dll_crt0_1 that aren't done
for the forkee. */
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index d205c26bc..30d1dd749 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -792,7 +792,8 @@ spawn_guts (const char * prog_arg, const char *const *argv,
if (!child)
{
syscall_printf ("pinfo failed");
- set_errno (EAGAIN);
+ if (get_errno () != ENOMEM)
+ set_errno (EAGAIN);
res = -1;
goto out;
}