summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-03-31 14:50:20 -0700
committerBen Pfaff <blp@nicira.com>2011-04-04 10:58:54 -0700
commitfe1e967e3bc6c04f773b150fbb358b2350d0ad8c (patch)
treee001b4fa8fe508337c9e6152fedab58d2dee834f /lib
parent1c5a216a80ce40c6af79a8919c7f5a06d1b97a90 (diff)
downloadopenvswitch-fe1e967e3bc6c04f773b150fbb358b2350d0ad8c.tar.gz
Add a few more users for ovs_retval_to_string().
Diffstat (limited to 'lib')
-rw-r--r--lib/entropy.c3
-rw-r--r--lib/ovsdb-error.c10
-rw-r--r--lib/unixctl.c5
3 files changed, 5 insertions, 13 deletions
diff --git a/lib/entropy.c b/lib/entropy.c
index 8a6479bef..1f1af50a5 100644
--- a/lib/entropy.c
+++ b/lib/entropy.c
@@ -47,8 +47,7 @@ get_entropy(void *buffer, size_t n)
close(fd);
if (error) {
- VLOG_ERR("%s: read error (%s)", urandom,
- error == EOF ? "unexpected end of file" : strerror(error));
+ VLOG_ERR("%s: read error (%s)", urandom, ovs_retval_to_string(error));
}
return error;
}
diff --git a/lib/ovsdb-error.c b/lib/ovsdb-error.c
index 3b90b1616..0ac93dc65 100644
--- a/lib/ovsdb-error.c
+++ b/lib/ovsdb-error.c
@@ -192,12 +192,6 @@ ovsdb_error_clone(const struct ovsdb_error *old)
}
}
-static const char *
-ovsdb_errno_string(int error)
-{
- return error == EOF ? "unexpected end of file" : strerror(error);
-}
-
struct json *
ovsdb_error_to_json(const struct ovsdb_error *error)
{
@@ -211,7 +205,7 @@ ovsdb_error_to_json(const struct ovsdb_error *error)
}
if (error->errno_) {
json_object_put_string(json, "io-error",
- ovsdb_errno_string(error->errno_));
+ ovs_retval_to_string(error->errno_));
}
return json;
}
@@ -228,7 +222,7 @@ ovsdb_error_to_string(const struct ovsdb_error *error)
ds_put_format(&ds, ": %s", error->details);
}
if (error->errno_) {
- ds_put_format(&ds, " (%s)", ovsdb_errno_string(error->errno_));
+ ds_put_format(&ds, " (%s)", ovs_retval_to_string(error->errno_));
}
return ds_steal_cstr(&ds);
}
diff --git a/lib/unixctl.c b/lib/unixctl.c
index 6e0b19ff6..c333c54e9 100644
--- a/lib/unixctl.c
+++ b/lib/unixctl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2011 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -568,8 +568,7 @@ unixctl_client_transact(struct unixctl_client *client,
if (error) {
VLOG_WARN("error reading reply from %s: %s",
client->connect_path,
- (error == EOF ? "unexpected end of file"
- : strerror(error)));
+ ovs_retval_to_string(error));
goto error;
}