projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
8b85f11
)
create_core should wait for the child to be done writing the core
author
Trond Norbye
<trond.norbye@sun.com>
Thu, 17 Dec 2009 09:25:19 +0000
(10:25 +0100)
committer
Trond Norbye
<trond.norbye@sun.com>
Thu, 17 Dec 2009 09:25:19 +0000
(10:25 +0100)
tests/test.c
patch
|
blob
|
history
diff --git
a/tests/test.c
b/tests/test.c
index f95141b107ee557db0ee09b85723c8f31ef5a5aa..793bcbd7264d08af68112aefa033e4e931af0980 100644
(file)
--- a/
tests/test.c
+++ b/
tests/test.c
@@
-15,6
+15,7
@@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <unistd.h>
#include <time.h>
#include <fnmatch.h>
@@
-62,8
+63,22
@@
static const char *test_strerror(test_return_t code)
void create_core(void)
{
- if (getenv("LIBMEMCACHED_NO_COREDUMP") == NULL && fork() == 0)
- abort();
+ if (getenv("LIBMEMCACHED_NO_COREDUMP") == NULL)
+ {
+ pid_t pid= fork();
+
+ if (pid == 0)
+ {
+ abort();
+ }
+ else
+ {
+ while (waitpid(pid, NULL, 0) != pid)
+ {
+ ;
+ }
+ }
+ }
}