git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sliver-ovs: ignore pid files when starting servers
[sliver-openvswitch.git]
/
lib
/
process.c
diff --git
a/lib/process.c
b/lib/process.c
index
03e00ce
..
5dd34b3
100644
(file)
--- a/
lib/process.c
+++ b/
lib/process.c
@@
-28,6
+28,7
@@
#include "dynamic-string.h"
#include "fatal-signal.h"
#include "list.h"
#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"
#include "poll-loop.h"
#include "signals.h"
#include "socket-util.h"
@@
-36,7
+37,6
@@
VLOG_DEFINE_THIS_MODULE(process);
VLOG_DEFINE_THIS_MODULE(process);
-COVERAGE_DEFINE(process_sigchld);
COVERAGE_DEFINE(process_start);
struct process {
COVERAGE_DEFINE(process_start);
struct process {
@@
-71,6
+71,7
@@
process_init(void)
static bool inited;
struct sigaction sa;
static bool inited;
struct sigaction sa;
+ assert_single_threaded();
if (inited) {
return;
}
if (inited) {
return;
}
@@
-180,6
+181,8
@@
process_start(char **argv, struct process **pp)
pid_t pid;
int error;
pid_t pid;
int error;
+ assert_single_threaded();
+
*pp = NULL;
COVERAGE_INC(process_start);
error = process_prestart(argv);
*pp = NULL;
COVERAGE_INC(process_start);
error = process_prestart(argv);
@@
-189,7
+192,7
@@
process_start(char **argv, struct process **pp)
pid = fork();
if (pid < 0) {
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. */
return errno;
} else if (pid) {
/* Running in parent process. */
@@
-206,7
+209,7
@@
process_start(char **argv, struct process **pp)
}
execvp(argv[0], argv);
fprintf(stderr, "execvp(\"%s\") failed: %s\n",
}
execvp(argv[0], argv);
fprintf(stderr, "execvp(\"%s\") failed: %s\n",
- argv[0], strerror(errno));
+ argv[0],
ovs_
strerror(errno));
_exit(1);
}
}
_exit(1);
}
}
@@
-312,7
+315,7
@@
process_run(void)
p->exited = true;
p->status = status;
} else if (retval < 0) {
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;
}
p->exited = true;
p->status = -1;
}