X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fprocess.c;h=143347ca50ce0dff1db72c52b1caa7dc848d2706;hb=26131299fa56345d4eb5adfb631cdd7c7310a592;hp=03e00ce1abcdbb0a3a7bfded63c8e8f5da65264c;hpb=ff412c8c09041196bdb5691d4f75bd8540b630c9;p=sliver-openvswitch.git diff --git a/lib/process.c b/lib/process.c index 03e00ce1a..143347ca5 100644 --- a/lib/process.c +++ b/lib/process.c @@ -28,6 +28,7 @@ #include "dynamic-string.h" #include "fatal-signal.h" #include "list.h" +#include "ovs-thread.h" #include "poll-loop.h" #include "signals.h" #include "socket-util.h" @@ -71,6 +72,7 @@ process_init(void) static bool inited; struct sigaction sa; + assert_single_threaded(); if (inited) { return; } @@ -180,6 +182,8 @@ process_start(char **argv, struct process **pp) pid_t pid; int error; + assert_single_threaded(); + *pp = NULL; COVERAGE_INC(process_start); error = process_prestart(argv); @@ -189,7 +193,7 @@ process_start(char **argv, struct process **pp) pid = fork(); if (pid < 0) { - VLOG_WARN("fork failed: %s", strerror(errno)); + VLOG_WARN("fork failed: %s", ovs_strerror(errno)); return errno; } else if (pid) { /* Running in parent process. */ @@ -206,7 +210,7 @@ process_start(char **argv, struct process **pp) } execvp(argv[0], argv); fprintf(stderr, "execvp(\"%s\") failed: %s\n", - argv[0], strerror(errno)); + argv[0], ovs_strerror(errno)); _exit(1); } } @@ -312,7 +316,7 @@ process_run(void) p->exited = true; p->status = status; } else if (retval < 0) { - VLOG_WARN("waitpid: %s", strerror(errno)); + VLOG_WARN("waitpid: %s", ovs_strerror(errno)); p->exited = true; p->status = -1; }