mirror of
https://github.com/openvswitch/ovs
synced 2025-09-03 15:55:19 +00:00
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.)
This commit is contained in:
@@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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);
|
NULL);
|
||||||
if (server->fd < 0) {
|
if (server->fd < 0) {
|
||||||
error = -server->fd;
|
error = -server->fd;
|
||||||
fprintf(stderr, "Could not initialize control socket %s (%s)\n",
|
ovs_error(error, "could not initialize control socket %s",
|
||||||
server->path, strerror(error));
|
server->path);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chmod(server->path, S_IRUSR | S_IWUSR) < 0) {
|
if (chmod(server->path, S_IRUSR | S_IWUSR) < 0) {
|
||||||
error = errno;
|
error = errno;
|
||||||
fprintf(stderr, "Failed to chmod control socket %s (%s)\n",
|
ovs_error(error, "failed to chmod control socket %s", server->path);
|
||||||
server->path, strerror(error));
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listen(server->fd, 10) < 0) {
|
if (listen(server->fd, 10) < 0) {
|
||||||
error = errno;
|
error = errno;
|
||||||
fprintf(stderr, "Failed to listen on control socket %s (%s)\n",
|
ovs_error(error, "Failed to listen on control socket %s",
|
||||||
server->path, strerror(error));
|
server->path);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user