summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f28c4b0)
raw | patch | inline | side by side (parent: f28c4b0)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 22 Oct 2013 07:00:55 +0000 (09:00 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 22 Oct 2013 07:00:55 +0000 (09:00 +0200) |
src/frontend/sock.c | patch | blob | history |
diff --git a/src/frontend/sock.c b/src/frontend/sock.c
index 063b2ca3d1d6528d0a22c7304faab65408e398c2..e2c52ce31b2cbf3a0dba089187de4efd8ceac5fb 100644 (file)
--- a/src/frontend/sock.c
+++ b/src/frontend/sock.c
listener->sock_fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (listener->sock_fd < 0) {
char buf[1024];
- sdb_log(SDB_LOG_ERR, "sock: Failed to open UNIX socket: %s",
- sdb_strerror(errno, buf, sizeof(buf)));
+ sdb_log(SDB_LOG_ERR, "sock: Failed to open UNIX socket %s: %s",
+ listener->address, sdb_strerror(errno, buf, sizeof(buf)));
return -1;
}
status = bind(listener->sock_fd, (struct sockaddr *)&sa, sizeof(sa));
if (status) {
char buf[1024];
- sdb_log(SDB_LOG_ERR, "sock: Failed to bind to UNIX socket: %s",
- sdb_strerror(errno, buf, sizeof(buf)));
+ sdb_log(SDB_LOG_ERR, "sock: Failed to bind to UNIX socket %s: %s",
+ listener->address, sdb_strerror(errno, buf, sizeof(buf)));
return -1;
}
return 0;
int type;
type = get_type(address);
- if (type < 0)
+ if (type < 0) {
+ sdb_log(SDB_LOG_ERR, "sock: Unsupported address type specified "
+ "in listen address '%s'", address);
return NULL;
+ }
listener = realloc(sock->listeners,
sock->listeners_num * sizeof(*sock->listeners));
- if (! listener)
+ if (! listener) {
+ char buf[1024];
+ sdb_log(SDB_LOG_ERR, "sock: Failed to allocate memory: %s",
+ sdb_strerror(errno, buf, sizeof(buf)));
return NULL;
+ }
+
sock->listeners = listener;
listener = sock->listeners + sock->listeners_num;
listener->sock_fd = -1;
listener->address = strdup(address);
if (! listener->address) {
+ char buf[1024];
+ sdb_log(SDB_LOG_ERR, "sock: Failed to allocate memory: %s",
+ sdb_strerror(errno, buf, sizeof(buf)));
listener_destroy(listener);
return NULL;
}
listener->type = type;
if (listener_impls[type].opener(listener)) {
+ /* prints error */
listener_destroy(listener);
return NULL;
}