#include "dirs.h"
#include "dummy.h"
#include "dynamic-string.h"
+#include "fatal-signal.h"
#include "file.h"
#include "hash.h"
#include "json.h"
#include "shash.h"
#include "stream-ssl.h"
#include "stream.h"
-#include "stress.h"
#include "sset.h"
#include "table.h"
#include "timeval.h"
proctitle_init(argc, argv);
set_program_name(argv[0]);
- stress_init_command();
- signal(SIGPIPE, SIG_IGN);
+ service_start(&argc, &argv);
+ fatal_ignore_sigpipe();
process_init();
parse_options(&argc, &argv, &remotes, &unixctl_path, &run_command);
}
poll_timer_wait_until(status_timer);
poll_block();
+ if (should_service_stop()) {
+ exiting = true;
+ }
}
ovsdb_jsonrpc_server_destroy(jsonrpc);
SHASH_FOR_EACH(node, &all_dbs) {
}
}
+ service_stop();
return 0;
}
if (!VLOG_DROP_DBG(&rl)) {
char *type_name = ovsdb_type_to_english(&column->type);
VLOG_DBG("Table `%s' column `%s' has type %s, not expected "
- "key type %s, value type %s, max elements %zd.",
+ "key type %s, value type %s, max elements %"PRIuSIZE".",
schema->name, column_name, type_name,
ovsdb_atomic_type_to_string(key_type),
ovsdb_atomic_type_to_string(value_type),
char *s = ovsdb_error_to_string(error);
ds_put_format(&reply, "%s\n", s);
free(s);
+ ovsdb_error_destroy(error);
}
n++;
static const struct option long_options[] = {
{"remote", required_argument, NULL, OPT_REMOTE},
{"unixctl", required_argument, NULL, OPT_UNIXCTL},
+#ifndef _WIN32
{"run", required_argument, NULL, OPT_RUN},
+#endif
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
DAEMON_LONG_OPTIONS,
char *s;
if (ftruncate(fileno(config_file), 0) == -1) {
- VLOG_FATAL("failed to truncate temporary file (%s)", strerror(errno));
+ VLOG_FATAL("failed to truncate temporary file (%s)",
+ ovs_strerror(errno));
}
obj = json_object_create();
if (fseek(config_file, 0, SEEK_SET) != 0
|| fputs(s, config_file) == EOF
|| fflush(config_file) == EOF) {
- VLOG_FATAL("failed to write temporary file (%s)", strerror(errno));
+ VLOG_FATAL("failed to write temporary file (%s)", ovs_strerror(errno));
}
free(s);
}
struct json *json;
if (fseek(config_file, 0, SEEK_SET) != 0) {
- VLOG_FATAL("seek failed in temporary file (%s)", strerror(errno));
+ VLOG_FATAL("seek failed in temporary file (%s)", ovs_strerror(errno));
}
json = json_from_stream(config_file);
if (json->type == JSON_STRING) {