summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5f10b5e)
raw | patch | inline | side by side (parent: 5f10b5e)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 11 Dec 2012 08:06:57 +0000 (09:06 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 11 Dec 2012 08:06:57 +0000 (09:06 +0100) |
src/utils/unixsock.c | patch | blob | history |
diff --git a/src/utils/unixsock.c b/src/utils/unixsock.c
index 1be17b9994600878024a8f3b9a4c1a15d1e96eb4..70fd273679bf170f7fd40fd29d2e4417f142beb3 100644 (file)
--- a/src/utils/unixsock.c
+++ b/src/utils/unixsock.c
@@ -144,10 +144,12 @@ sc_unixsock_client_recv(sc_unixsock_client_t *client, char *buffer, size_t bufle
return NULL;
buffer = fgets(buffer, (int)buflen - 1, client->fh);
- if ((! buffer) && (! feof(client->fh))) {
- char errbuf[1024];
- fprintf(stderr, "unixsock: Failed to read from socket (%s): %s\n",
- client->path, sc_strerror(errno, errbuf, sizeof(errbuf)));
+ if (! buffer) {
+ if (! feof(client->fh)) {
+ char errbuf[1024];
+ fprintf(stderr, "unixsock: Failed to read from socket (%s): %s\n",
+ client->path, sc_strerror(errno, errbuf, sizeof(errbuf)));
+ }
return buffer;
}
buffer[buflen - 1] = '\0';