diff options
author | Thomas <thomas@xteddy.org> | 2014-01-20 10:48:12 +0000 |
---|---|---|
committer | Thomas <thomas@xteddy.org> | 2014-01-20 10:48:12 +0000 |
commit | d02c4bda3a4b456f654fb0c1b454ba9724bff0f3 (patch) | |
tree | 95f3d17d7f1525e05ed298a015166af557988a0e /client.c | |
parent | ba014c1a605f78b301b47ef922dd24a3c5c2c4c1 (diff) | |
parent | 938768ed3de3e38cb96344b8ec7b794b5e828acf (diff) |
Merge branch 'obsd-master'
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -118,10 +118,15 @@ retry: close(fd); xasprintf(&lockfile, "%s.lock", path); - if ((lockfd = client_get_lock(lockfile)) == -1) + if ((lockfd = client_get_lock(lockfile)) == -1) { + free(lockfile); goto retry; - if (unlink(path) != 0 && errno != ENOENT) + } + if (unlink(path) != 0 && errno != ENOENT) { + free(lockfile); + close(lockfd); return (-1); + } fd = server_start(lockfd, lockfile); free(lockfile); close(lockfd); @@ -232,7 +237,8 @@ client_main(int argc, char **argv, int flags) /* Initialise the client socket and start the server. */ fd = client_connect(socket_path, cmdflags & CMD_STARTSERVER); if (fd == -1) { - fprintf(stderr, "failed to connect to server\n"); + fprintf(stderr, "failed to connect to server: %s\n", + strerror(errno)); return (1); } |