On Thu, Sep 12, 2013 at 07:02:39PM -0700, Paul Ingram wrote:
> On Sep 11, 2013, at 10:41 PM, Ben Pfaff <b...@nicira.com> wrote:
> > 
> > This patch also needs your sign-off.
> 
> OK, included with sign-off and a check which I mysteriously left out
> of the original patch.

On a second look, I'm mostly happy with this but I'd like to fold in the
following because INT_MAX is not 100% predictable.

Also, the following paragraph in commit message makes me wonder whether
this patch fixes a bug?  If it does then it may be worth backporting:
> The ovsdb-server compaction timing logic is written assuming milliscond
> resolution timestamps but ovsdb-server wrote second resolution timestamps.

Thanks,

Ben.

diff --git a/ovsdb/file.c b/ovsdb/file.c
index 5b79f8c..21dde9e 100644
--- a/ovsdb/file.c
+++ b/ovsdb/file.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
+/* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -408,7 +408,7 @@ ovsdb_file_txn_from_json(struct ovsdb *db, const struct 
json *json,
             if (!strcmp(table_name, "_date")
                 && node_json->type == JSON_INTEGER) {
                 *date = json_integer(node_json);
-                if (*date < INT_MAX) {
+                if (*date < INT32_MAX) {
                     /* Older versions of ovsdb wrote timestamps in seconds. */
                     *date *= 1000;
                 }
diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
index ade3d87..6d9c86f 100644
--- a/ovsdb/ovsdb-tool.c
+++ b/ovsdb/ovsdb-tool.c
@@ -519,12 +519,14 @@ do_show_log(int argc, char *argv[])
             date = shash_find_data(json_object(json), "_date");
             if (date && date->type == JSON_INTEGER) {
                 long long int t = json_integer(date);
-                if (t < INT_MAX) {
+                char *s;
+
+                if (t < INT32_MAX) {
                     /* Older versions of ovsdb wrote timestamps in seconds. */
                     t *= 1000;
                 }
 
-                char *s = xastrftime_msec(" %Y-%m-%d %H:%M:%S.###", t, true);
+                s = xastrftime_msec(" %Y-%m-%d %H:%M:%S.###", t, true);
                 fputs(s, stdout);
                 free(s);
             }
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to