pid_t pid;
char * data;
size_t len;
+ char const * errptr;
if (argc>1) {
if (strcmp(argv[1], "--help") ==0) showHelp(1, argv[0], 0);
if (strcmp(argv[1], "--version")==0) showVersion();
}
-
- if (vc_get_task_xid(0)!=1)
- Evc_new_s_context(1, vc_get_insecurecaps(), 0);
+
+ if (!switchToWatchXid(&errptr)) {
+ perror(errptr);
+ exit(wrapper_exit_code);
+ }
Epipe(p);
pid = Efork();
pos = strstr(buf, "\ninitpid: ");
if (pos!=0) {
- pos += sizeof("\ninitpid: ")-1;
+ pos += sizeof("\ninitpid: ")-1;
if (strncmp(pos, "none", 4)==0) *res = -1;
else *res = atoi(pos);
}
{
struct dirent **namelist;
int n;
-
- vc_new_s_context(1,0,0); // ignore errors silently...
+
+ switchToWatchXid(0); // ignore errors silently...
n = scandir("/proc", &namelist, selectPid, alphasort);
if (n<0) perror("scandir()");
else while (n--) {
struct dirent* dir_entry;
pid_t my_pid;
struct Vector xid_data;
+ char const * errptr;
if (argc==2) {
if (strcmp(argv[1], "--help") ==0) showHelp(1, argv[0], 0);
// do not include own stat
my_pid = getpid();
-#if 1
- // try to switch in context 1
- if (vc_get_task_xid(0)!=1)
- Evc_new_s_context(1, 0,0);
-#else
-# warning Compiling in debug-code
-#endif
+ if (!switchToWatchXid(&errptr)) {
+ perror(errptr);
+ exit(1);
+ }
Vector_init(&xid_data, sizeof(struct XidData));