added support for $(pkgcachedir)
[util-vserver.git] / util-vserver / src / chcontext.c
index cda4c80..0e0ae48 100644 (file)
@@ -40,6 +40,7 @@
 #include <assert.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <signal.h>
 
 #define ENSC_WRAPPERS_PREFIX   "chcontext: "
 #define ENSC_WRAPPERS_VSERVER  1
@@ -210,7 +211,7 @@ setFlags(char const *str, uint32_t *flags)
 
   if (err.ptr!=0) {
     WRITE_MSG(2, "Unknown flag '");
-    write(2, err.ptr, err.len);
+    Vwrite(2, err.ptr, err.len);
     WRITE_MSG(2, "'\n");
     exit(wrapper_exit_code);
   }
@@ -259,7 +260,7 @@ tellContext(xid_t ctx)
   l = utilvserver_fmt_long(buf,ctx);
 
   WRITE_MSG(1, "New security context is ");
-  write(1, buf, l);
+  Vwrite(1, buf, l);
   WRITE_MSG(1, "\n");
 }
 
@@ -283,7 +284,8 @@ int main (int argc, char *argv[])
   pid_t                pid;
   
   global_args = &args;
-  
+  signal(SIGCHLD, SIG_DFL);
+
   while (1) {
     int                c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0);
     if (c==-1) break;