Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 175215 Details for
Bug 250843
<=app-shell/bash-3.2_p48 and <=dev-lang/python-2.6-r5 don't handle EAGAIN returned by fork() properly
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix fork() failing on EAGAIN in Bash
bash-3.2-EAGAIN.patch (text/plain), 665 bytes, created by
Alex Volkov
on 2008-12-13 16:33:12 UTC
(
hide
)
Description:
fix fork() failing on EAGAIN in Bash
Filename:
MIME Type:
Creator:
Alex Volkov
Created:
2008-12-13 16:33:12 UTC
Size:
665 bytes
patch
obsolete
>--- jobs.c.ori Thu Jun 5 05:54:12 2008 >+++ jobs.c Thu Jun 5 06:00:03 2008 >@@ -1670,6 +1670,7 @@ > { > sigset_t set, oset; > pid_t pid; >+ unsigned int forksleep; > > sigemptyset (&set); > sigaddset (&set, SIGCHLD); >@@ -1690,8 +1691,16 @@ > #endif /* BUFFERED_INPUT */ > > /* Create the child, handle severe errors. */ >- if ((pid = fork ()) < 0) >+ forksleep = 1; >+ while ((pid = fork ()) < 0 && errno == EAGAIN && forksleep < 32) > { >+ if (sleep (forksleep)) break; /* break on signals, e.g. ^C */ >+ forksleep <<= 1; >+ } >+ >+ if (pid < 0) >+ { >+ > sys_error ("fork"); > > /* Kill all of the processes in the current pipeline. */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 250843
:
175215
|
175216
|
175328