summaryrefslogtreecommitdiff
path: root/lib/unixctl.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-01-15 10:31:06 -0800
committerBen Pfaff <blp@nicira.com>2010-01-15 11:33:18 -0800
commita723bf84fb639262d2bf7e33b7640a9621bb19b5 (patch)
treed1b4b97b9a0cac25815524b95b1ba9c46760d208 /lib/unixctl.c
parent4a8535f39d5c4f6f34534ea1dcf9f35cddbde0c7 (diff)
downloadopenvswitch-a723bf84fb639262d2bf7e33b7640a9621bb19b5.tar.gz
unixctl: Improve error reporting.
The ovs_error() function is our standard way of reporting startup errors, so use it. (It also outputs the program name at the beginning of the message.)
Diffstat (limited to 'lib/unixctl.c')
-rw-r--r--lib/unixctl.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/unixctl.c b/lib/unixctl.c
index 637843941..e648cc865 100644
--- a/lib/unixctl.c
+++ b/lib/unixctl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -200,22 +200,21 @@ unixctl_server_create(const char *path, struct unixctl_server **serverp)
NULL);
if (server->fd < 0) {
error = -server->fd;
- fprintf(stderr, "Could not initialize control socket %s (%s)\n",
- server->path, strerror(error));
+ ovs_error(error, "could not initialize control socket %s",
+ server->path);
goto error;
}
if (chmod(server->path, S_IRUSR | S_IWUSR) < 0) {
error = errno;
- fprintf(stderr, "Failed to chmod control socket %s (%s)\n",
- server->path, strerror(error));
+ ovs_error(error, "failed to chmod control socket %s", server->path);
goto error;
}
if (listen(server->fd, 10) < 0) {
error = errno;
- fprintf(stderr, "Failed to listen on control socket %s (%s)\n",
- server->path, strerror(error));
+ ovs_error(error, "Failed to listen on control socket %s",
+ server->path);
goto error;
}