Index: histrap.c
===================================================================
RCS file: /cvs/src/bin/mksh/histrap.c,v
retrieving revision 1.111
diff -u -r1.111 histrap.c
--- histrap.c 7 Sep 2011 15:24:40 -0000 1.111
+++ histrap.c 21 Nov 2011 10:17:25 -0000
@@ -1127,7 +1127,9 @@
/* SIGTERM is not fatal for interactive */
sigtraps[SIGTERM].flags |= TF_DFL_INTR;
sigtraps[SIGHUP].flags |= TF_FATAL;
+#ifdef SIGCLD
sigtraps[SIGCHLD].flags |= TF_SHELL_USES;
+#endif
/* these are always caught so we can clean up any temporary files. */
setsig(&sigtraps[SIGINT], trapsig, SS_RESTORE_ORIG);
Index: jobs.c
===================================================================
RCS file: /cvs/src/bin/mksh/jobs.c,v
retrieving revision 1.81
diff -u -r1.81 jobs.c
--- jobs.c 27 Aug 2011 18:07:10 -0000 1.81
+++ jobs.c 21 Nov 2011 10:21:14 -0000
@@ -171,7 +171,9 @@
SS_RESTORE_ORIG|SS_FORCE|SS_SHTRAP);
#else
/* Make sure SIGCHLD isn't ignored - can do odd things under SYSV */
+# ifdef SIGCHLD
setsig(&sigtraps[SIGCHLD], SIG_DFL, SS_RESTORE_ORIG|SS_FORCE);
+# endif
#endif
#ifndef MKSH_UNEMPLOYED
@@ -1078,7 +1080,9 @@
#ifndef MKSH_NOPROSPECTOFWORK
sigsuspend(&sm_default);
#else
+# ifdef SIGCHLD
j_sigchld(SIGCHLD);
+# endif
#endif
if (fatal_trap) {
int oldf = j->flags & (JF_WAITING|JF_W_ASYNCNOTIFY);
Index: misc.c
===================================================================
RCS file: /cvs/src/bin/mksh/misc.c,v
retrieving revision 1.177
diff -u -r1.177 misc.c
--- misc.c 26 Oct 2011 20:46:39 -0000 1.177
+++ misc.c 21 Nov 2011 10:46:30 -0000
@@ -249,9 +249,14 @@
DO_SETUID(setresuid, (ksheuid, ksheuid, ksheuid));
#else
/* seteuid, setegid, setgid don't EAGAIN on Linux */
- seteuid(ksheuid = kshuid = getuid());
+ ksheuid = kshuid = getuid();
+#ifndef DJGPP
+ seteuid(ksheuid);
+#endif
DO_SETUID(setuid, (ksheuid));
+#ifndef DJGPP
setegid(kshegid);
+#endif
setgid(kshegid);
#endif
} else if ((f == FPOSIX || f == FSH) && newval) {