From: Ben Pfaff Date: Fri, 6 Nov 2009 21:35:32 +0000 (-0800) Subject: ovsdb-tool: Make "query" and "transact" commands work properly. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b681e6fdffe4ebd68dc259544abc87d4cccf0cb;p=openvswitch ovsdb-tool: Make "query" and "transact" commands work properly. These were passing O_RDONLY or O_RDWR as arguments to a function that expected "true" or "false", respectively. --- diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c index 5169653d..d6e0ff94 100644 --- a/ovsdb/ovsdb-tool.c +++ b/ovsdb/ovsdb-tool.c @@ -162,12 +162,12 @@ do_create(int argc UNUSED, char *argv[]) } static void -transact(int flags, const char *db_file_name, const char *transaction) +transact(bool read_only, const char *db_file_name, const char *transaction) { struct json *request, *result; struct ovsdb *db; - check_ovsdb_error(ovsdb_open(db_file_name, flags, &db)); + check_ovsdb_error(ovsdb_open(db_file_name, read_only, &db)); request = parse_json(transaction); result = ovsdb_execute(db, request, 0, NULL); @@ -180,13 +180,13 @@ transact(int flags, const char *db_file_name, const char *transaction) static void do_query(int argc UNUSED, char *argv[]) { - transact(O_RDONLY, argv[1], argv[2]); + transact(true, argv[1], argv[2]); } static void do_transact(int argc UNUSED, char *argv[]) { - transact(O_RDWR, argv[1], argv[2]); + transact(false, argv[1], argv[2]); } static void