#include "column.h"
#include "command-line.h"
#include "daemon.h"
+#include "dirs.h"
#include "file.h"
#include "json.h"
#include "jsonrpc.h"
if (error) {
ovs_fatal(0, "%s", ovsdb_error_to_string(error));
}
+ free(file_name);
jsonrpc = ovsdb_jsonrpc_server_create(db);
reconfigure_from_db(jsonrpc, db, &remotes);
argc -= optind;
argv += optind;
- if (argc > 1) {
+ switch (argc) {
+ case 0:
+ *file_namep = xasprintf("%s/openvswitch/conf.db", ovs_sysconfdir());
+ break;
+
+ case 1:
+ *file_namep = xstrdup(argv[0]);
+ break;
+
+ default:
ovs_fatal(0, "database file is only non-option argument; "
"use --help for usage");
- } else if (argc < 1) {
- ovs_fatal(0, "missing database file argument; use --help for usage");
}
-
- *file_namep = argv[0];
}
static void