|
From: <sv...@va...> - 2014-02-17 22:45:02
|
Author: tom
Date: Mon Feb 17 22:44:52 2014
New Revision: 13813
Log:
Use pclose instead of fclose to close pipes opened with popen, which
also allows us to drop the loop that was supposed to give the child a
chance to exit as the pclose will wait properly for the child.
Fix from Ivo Raisr on BZ#331255
Modified:
trunk/NEWS
trunk/none/tests/coolo_sigaction.cpp
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Mon Feb 17 22:44:52 2014
@@ -52,6 +52,7 @@
330469 Add clock_adjtime syscall support
330939 Support for AMD's syscall instruction on x86
330941 Typo in PRE(poll) syscall wrapper
+331255 Fix race condition in test none/tests/coolo_sigaction
331257 Fix type of jump buffer in test none/tests/faultstatus
n-i-bz Fix KVM_CREATE_IRQCHIP ioctl handling
Modified: trunk/none/tests/coolo_sigaction.cpp
==============================================================================
--- trunk/none/tests/coolo_sigaction.cpp (original)
+++ trunk/none/tests/coolo_sigaction.cpp Mon Feb 17 22:44:52 2014
@@ -40,7 +40,6 @@
int main()
{
- int i;
char buffer[200];
setupHandlers();
FILE *p = popen("echo Hallo World", "r");
@@ -48,7 +47,6 @@
int n = fread(buffer, 200, 1, p);
__attribute__((unused)) ssize_t nw = write(2, buffer, n);
}
- fclose(p);
- for (i = 0; i < 1000000; i++) ;
+ pclose(p);
return 0;
}
|