On Fri, Nov 10, 2006 at 11:43:56AM -0800, Nishanth Aravamudan wrote: > Fix linkshare testcase to catch the case where the sharing children are > killed by a signal. Currently, if a child segfaults, we still PASS the > test, when it clearly should be a FAIL case.
Um.. yes, we certainly want this. > diff --git a/tests/linkshare.c b/tests/linkshare.c > index 3461a7d..5d174e2 100644 > --- a/tests/linkshare.c > +++ b/tests/linkshare.c > @@ -216,12 +216,18 @@ int main(int argc, char *argv[], char *e > } > } > for (i = 0; i < num_sharings; i++) { > - ret = waitpid(children[i], NULL, 0); > + int status; > + ret = waitpid(children[i], &status, 0); > if (ret < 0) { > shmctl(shmid, IPC_RMID, NULL); > shmdt(shm); > FAIL("waitpid failed: %s", strerror(errno)); > } > + if (WIFEXITED(status)) > + continue; But we should also FAIL() on non-zero return status. > + if (WIFSIGNALED(status)) > + FAIL("Child %d was killed by signal %d\n", > + i+1, WTERMSIG(status)); > } > for (i = 0; i < NUM_TESTS; i++) { > ino_t base = shm[i]; > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel