From c12b1910b22f0cc408a91f149fd67f6de9629df5 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Mon, 28 Sep 1998 16:04:02 +0000 Subject: [PATCH] (try_pipe): return -1 if I_PUSH fails with ENOSYS git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5167 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/kx/common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/appl/kx/common.c b/appl/kx/common.c index 3710d7be2..71dac7189 100644 --- a/appl/kx/common.c +++ b/appl/kx/common.c @@ -186,7 +186,7 @@ try_pipe (struct x_socket *s, int dpy, const char *pattern) int ret; int fd; int pipefd[2]; - + snprintf (path, sizeof(path), pattern, dpy); fd = open (path, O_WRONLY | O_CREAT | O_EXCL, 0600); if (fd < 0) @@ -202,8 +202,11 @@ try_pipe (struct x_socket *s, int dpy, const char *pattern) err (1, "pipe"); ret = ioctl (pipefd[1], I_PUSH, "connld"); - if (ret < 0) + if (ret < 0) { + if(errno == ENOSYS) + return -1; err (1, "ioctl I_PUSH"); + } ret = fattach (pipefd[1], path); if (ret < 0) @@ -334,7 +337,7 @@ get_xsockets (int *number, struct x_socket **sockets, int tcp_socket) for (path = x_pipes; *path; ++path) { tmp = try_pipe (&s[n], dpy, *path); if (tmp == -1) { - if (errno != ENOTDIR && errno != ENOENT) + if (errno != ENOTDIR && errno != ENOENT && errno != ENOSYS) return -1; } else if (tmp == 1) { while (--n >= 0) {