unlink temporary files on exit
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 24 Mar 2005 01:12:54 +0000 (01:12 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 24 Mar 2005 01:12:54 +0000 (01:12 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1974 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/lib_internal/testsuite/sigbus.c

index 9cb0940..ba6eb78 100644 (file)
@@ -83,6 +83,7 @@ int main()
   int          fd_dst    = mkstemp(f_name1);
   char         buf[TEST_BLOCKSIZE] = { [0] = '\0' };
   struct stat  st;
+  bool         res;
   
   fd_src = 
   
@@ -99,8 +100,12 @@ int main()
   is_gremlin = true;
 
   Esocketpair(AF_LOCAL, SOCK_STREAM, 0, sync_p);
+  signal(SIGCHLD, SIG_IGN);
 
-  return (checkTrunc(f_name0, f_name1, &st, TEST_BLOCKSIZE/2) &&
-         checkTrunc(f_name0, f_name1, &st, 0x2345)
-         ? EXIT_SUCCESS : EXIT_FAILURE);
+  res = (checkTrunc(f_name0, f_name1, &st, TEST_BLOCKSIZE/2) &&
+        checkTrunc(f_name0, f_name1, &st, 0x2345));
+
+  unlink(f_name0);
+  unlink(f_name1);
+  return res ? EXIT_SUCCESS : EXIT_FAILURE;
 }