From f3cf3216604b0cee818a572e375b256f23dabe5b Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Thu, 30 Jul 2009 12:32:23 +0200 Subject: [PATCH] Fail harder (exit) in case of failure [CID-76] --- appl/kx/common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appl/kx/common.c b/appl/kx/common.c index 362d50597..9c3b20672 100644 --- a/appl/kx/common.c +++ b/appl/kx/common.c @@ -270,7 +270,7 @@ get_xsockets (int *number, struct x_socket **sockets, int tcp_socket) tmp = try_socket (&s[n], dpy, *path); if (tmp == -1) { if (errno != ENOTDIR && errno != ENOENT) - return -1; + err(1, "failed to open '%s'", *path); } else if (tmp == 1) { while(--n >= 0) { close (s[n].fd); @@ -288,7 +288,7 @@ get_xsockets (int *number, struct x_socket **sockets, int tcp_socket) tmp = try_pipe (&s[n], dpy, *path); if (tmp == -1) { if (errno != ENOTDIR && errno != ENOENT && errno != ENOSYS) - return -1; + err(1, "failed to open '%s'", *path); } else if (tmp == 1) { while (--n >= 0) { close (s[n].fd); @@ -306,7 +306,7 @@ get_xsockets (int *number, struct x_socket **sockets, int tcp_socket) if (tcp_socket) { tmp = try_tcp (&s[n], dpy); if (tmp == -1) - return -1; + err(1, "failed to open tcp stocket"); else if (tmp == 1) { while (--n >= 0) { close (s[n].fd);