1. Index: histrap.c
  2. ===================================================================
  3. RCS file: /cvs/src/bin/mksh/histrap.c,v
  4. retrieving revision 1.111
  5. diff -u -r1.111 histrap.c
  6. --- histrap.c   7 Sep 2011 15:24:40 -0000   1.111
  7. +++ histrap.c   21 Nov 2011 10:17:25 -0000
  8. @@ -1127,7 +1127,9 @@
  9.     /* SIGTERM is not fatal for interactive */
  10.     sigtraps[SIGTERM].flags |= TF_DFL_INTR;
  11.     sigtraps[SIGHUP].flags |= TF_FATAL;
  12. +#ifdef SIGCLD
  13.     sigtraps[SIGCHLD].flags |= TF_SHELL_USES;
  14. +#endif
  15.  
  16.     /* these are always caught so we can clean up any temporary files. */
  17.     setsig(&sigtraps[SIGINT], trapsig, SS_RESTORE_ORIG);
  18. Index: jobs.c
  19. ===================================================================
  20. RCS file: /cvs/src/bin/mksh/jobs.c,v
  21. retrieving revision 1.81
  22. diff -u -r1.81 jobs.c
  23. --- jobs.c  27 Aug 2011 18:07:10 -0000  1.81
  24. +++ jobs.c  21 Nov 2011 10:21:14 -0000
  25. @@ -171,7 +171,9 @@
  26.         SS_RESTORE_ORIG|SS_FORCE|SS_SHTRAP);
  27.  #else
  28.     /* Make sure SIGCHLD isn't ignored - can do odd things under SYSV */
  29. +# ifdef SIGCHLD
  30.     setsig(&sigtraps[SIGCHLD], SIG_DFL, SS_RESTORE_ORIG|SS_FORCE);
  31. +# endif
  32.  #endif
  33.  
  34.  #ifndef MKSH_UNEMPLOYED
  35. @@ -1078,7 +1080,9 @@
  36.  #ifndef MKSH_NOPROSPECTOFWORK
  37.         sigsuspend(&sm_default);
  38.  #else
  39. +# ifdef SIGCHLD
  40.         j_sigchld(SIGCHLD);
  41. +# endif
  42.  #endif
  43.         if (fatal_trap) {
  44.             int oldf = j->flags & (JF_WAITING|JF_W_ASYNCNOTIFY);
  45. Index: misc.c
  46. ===================================================================
  47. RCS file: /cvs/src/bin/mksh/misc.c,v
  48. retrieving revision 1.177
  49. diff -u -r1.177 misc.c
  50. --- misc.c  26 Oct 2011 20:46:39 -0000  1.177
  51. +++ misc.c  21 Nov 2011 10:46:30 -0000
  52. @@ -249,9 +249,14 @@
  53.         DO_SETUID(setresuid, (ksheuid, ksheuid, ksheuid));
  54.  #else
  55.         /* seteuid, setegid, setgid don't EAGAIN on Linux */
  56. -       seteuid(ksheuid = kshuid = getuid());
  57. +       ksheuid = kshuid = getuid();
  58. +#ifndef DJGPP
  59. +       seteuid(ksheuid);
  60. +#endif
  61.         DO_SETUID(setuid, (ksheuid));
  62. +#ifndef DJGPP
  63.         setegid(kshegid);
  64. +#endif
  65.         setgid(kshegid);
  66.  #endif
  67.     } else if ((f == FPOSIX || f == FSH) && newval) {
  68.  
  69.  
  70.