mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/bash/bash2/avoid_WCONTINUED-1.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. Patch copied from: http://www.linuxfromscratch.org/lfs/view/development/chapter03/patches.html
  20. -stf
  21. Submitted By: Jeremy Utley <jeremy@linuxfromscratch.org>
  22. Date: 2004-10-13
  23. Initial Package Version: 3.0
  24. Upstream Status: Submitted Upstream
  25. Origin: Originally created by Greg Schafer
  26. Description: Bash-3.0 has a execution problem with newer Glibc's. This patch,
  27. submitted to bash-bugs by Tim Waugh, fixes the problem. See:
  28. http://lists.gnu.org/archive/html/bug-bash/2004-09/msg00081.html
  29. Patch also contains a slight code change taken from Fedora SRPM.
  30. diff -Naur bash-3.0.orig/jobs.c bash-3.0/jobs.c
  31. --- bash-3.0.orig/jobs.c 2004-10-12 08:50:11.643481280 +0000
  32. +++ bash-3.0/jobs.c 2004-10-12 08:51:35.110792320 +0000
  33. @@ -2476,6 +2476,7 @@
  34. PROCESS *child;
  35. pid_t pid;
  36. int call_set_current, last_stopped_job, job, children_exited, waitpid_flags;
  37. + static int wcontinued_not_supported = 0;
  38. call_set_current = children_exited = 0;
  39. last_stopped_job = NO_JOB;
  40. @@ -2489,7 +2490,15 @@
  41. : 0;
  42. if (sigchld || block == 0)
  43. waitpid_flags |= WNOHANG;
  44. + retry:
  45. + if (wcontinued_not_supported)
  46. + waitpid_flags &= ~WCONTINUED;
  47. pid = WAITPID (-1, &status, waitpid_flags);
  48. + if (pid == -1 && errno == EINVAL)
  49. + {
  50. + wcontinued_not_supported = 1;
  51. + goto retry;
  52. + }
  53. /* The check for WNOHANG is to make sure we decrement sigchld only
  54. if it was non-zero before we called waitpid. */