#include <lib/fmt.h>
#include <assert.h>
#include <fcntl.h>
+#include <signal.h>
+#include <errno.h>
#define ENSC_WRAPPERS_VSERVER 1
#define ENSC_WRAPPERS_STDLIB 1
if (strcmp(argv[1], "--version")==0) showVersion();
}
+ signal(SIGCHLD, SIG_DFL);
+
if (!switchToWatchXid(&errptr)) {
perror(errptr);
exit(wrapper_exit_code);
}
+ if (access("/proc/uptime",R_OK)==-1 && errno==ENOENT)
+ WRITE_MSG(2,
+ "WARNING: can not access /proc/uptime. Usually, this is caused by\n"
+ " procfs-security. Please read the FAQ for more details\n"
+ " http://www.linux-vserver.org/index.php?page=Linux-Vserver+FAQ\n");
+
Epipe(p);
pid = Efork();
Eclose(p[0]);
processOutput(data, len);
-
- exitLikeProcess(pid, "ps");
- perror("exitLikeProcess()");
- return wrapper_exit_code;
+ exitLikeProcess(pid, "ps", wrapper_exit_code);
}