Fail harder (exit) in case of failure [CID-76]

This commit is contained in:
Love Hornquist Astrand
2009-07-30 12:32:23 +02:00
parent 25b0f731ab
commit f3cf321660

View File

@@ -270,7 +270,7 @@ get_xsockets (int *number, struct x_socket **sockets, int tcp_socket)
tmp = try_socket (&s[n], dpy, *path); tmp = try_socket (&s[n], dpy, *path);
if (tmp == -1) { if (tmp == -1) {
if (errno != ENOTDIR && errno != ENOENT) if (errno != ENOTDIR && errno != ENOENT)
return -1; err(1, "failed to open '%s'", *path);
} else if (tmp == 1) { } else if (tmp == 1) {
while(--n >= 0) { while(--n >= 0) {
close (s[n].fd); 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); tmp = try_pipe (&s[n], dpy, *path);
if (tmp == -1) { if (tmp == -1) {
if (errno != ENOTDIR && errno != ENOENT && errno != ENOSYS) if (errno != ENOTDIR && errno != ENOENT && errno != ENOSYS)
return -1; err(1, "failed to open '%s'", *path);
} else if (tmp == 1) { } else if (tmp == 1) {
while (--n >= 0) { while (--n >= 0) {
close (s[n].fd); close (s[n].fd);
@@ -306,7 +306,7 @@ get_xsockets (int *number, struct x_socket **sockets, int tcp_socket)
if (tcp_socket) { if (tcp_socket) {
tmp = try_tcp (&s[n], dpy); tmp = try_tcp (&s[n], dpy);
if (tmp == -1) if (tmp == -1)
return -1; err(1, "failed to open tcp stocket");
else if (tmp == 1) { else if (tmp == 1) {
while (--n >= 0) { while (--n >= 0) {
close (s[n].fd); close (s[n].fd);