projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gre: Add support for destroying GRE devices.
[openvswitch]
/
ovsdb
/
ovsdb-client.c
diff --git
a/ovsdb/ovsdb-client.c
b/ovsdb/ovsdb-client.c
index fa17bd92ed731223c82bdfade9291987d99abf48..baf525d4e83e1690e531744ee8d49aef1f88db38 100644
(file)
--- a/
ovsdb/ovsdb-client.c
+++ b/
ovsdb/ovsdb-client.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009 Nicira Networks.
+ * Copyright (c) 2009
, 2010
Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-16,6
+16,7
@@
#include <config.h>
#include <config.h>
+#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <limits.h>
#include <errno.h>
#include <getopt.h>
#include <limits.h>
@@
-841,7
+842,14
@@
do_monitor(int argc, char *argv[])
&& json_equal(msg->id, request_id)) {
monitor_print(msg->result, table, &columns, true);
fflush(stdout);
&& json_equal(msg->id, request_id)) {
monitor_print(msg->result, table, &columns, true);
fflush(stdout);
- daemonize();
+ if (get_detach()) {
+ /* daemonize() closes the standard file descriptors. We output
+ * to stdout, so we need to save and restore STDOUT_FILENO. */
+ int fd = dup(STDOUT_FILENO);
+ daemonize();
+ dup2(fd, STDOUT_FILENO);
+ close(fd);
+ }
} else if (msg->type == JSONRPC_NOTIFY
&& !strcmp(msg->method, "update")) {
struct json *params = msg->params;
} else if (msg->type == JSONRPC_NOTIFY
&& !strcmp(msg->method, "update")) {
struct json *params = msg->params;