From 3a69ea87be4023e93c0ee317e627e72201fac8c7 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sat, 25 Mar 2000 18:07:38 +0000 Subject: zsh-workers/10243 --- Completion/User/_groups | 3 ++- Src/Modules/zpty.c | 43 ++++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Completion/User/_groups b/Completion/User/_groups index c4d53d32d..748536f3b 100644 --- a/Completion/User/_groups +++ b/Completion/User/_groups @@ -6,7 +6,8 @@ _wanted groups || return 1 if ! zstyle -a ":completion:${curcontext}:" groups groups; then (( $+_cache_groups )) || - if (( ${+commands[ypcat]} )) && tmp=$(ypcat group.byname); then + if (( ${+commands[ypcat]} )) && + tmp=$(_call groups ypcat group.byname); then : ${(A)_cache_groups:=${${(f)tmp}%%:*}} # If you use YP else : ${(A)_cache_groups:=${${(s: :)$( @@ -174,11 +174,12 @@ get_pty(int *master, int *slave) { int mfd, sfd; char *name; + int ret; if ((mfd = open("/dev/ptmx", O_RDWR)) < 0) return 1; - if (!(name = ptsname(mfd)) || grantpt(mfd) || unlockpt(mfd)) { + if (grantpt(mfd) || unlockpt(mfd) || !(name = ptsname(mfd))) { close(mfd); return 1; } @@ -186,31 +187,31 @@ get_pty(int *master, int *slave) close(mfd); return 1; } - if ((ret = ioctl(sfd, I_FIND, "ptem")) != 1) - if (ret == -1 || ioctl(sfd, I_PUSH, "ptem") == -1) { - close(mfd); - close(sfd); - return 1; - } - if ((ret = ioctl(sfd, I_FIND, "ldterm")) != 1) - if (ret == -1 || ioctl(sfd, I_PUSH, "ldterm") == -1) { - close(mfd); - close(sfd); - return 1; - } - if ((ret = ioctl(sfd, I_FIND, "ttcompat")) != 1) - if (ret == -1 || ioctl(sfd, I_PUSH, "ttcompat") == -1) { - close(mfd); - close(sfd); - return 1; - } + if ((ret = ioctl(sfd, I_FIND, "ptem")) != 1) + if (ret == -1 || ioctl(sfd, I_PUSH, "ptem") == -1) { + close(mfd); + close(sfd); + return 1; + } + if ((ret = ioctl(sfd, I_FIND, "ldterm")) != 1) + if (ret == -1 || ioctl(sfd, I_PUSH, "ldterm") == -1) { + close(mfd); + close(sfd); + return 1; + } + if ((ret = ioctl(sfd, I_FIND, "ttcompat")) != 1) + if (ret == -1 || ioctl(sfd, I_PUSH, "ttcompat") == -1) { + close(mfd); + close(sfd); + return 1; + } *master = mfd; *slave = sfd; return 0; } -#else /* ! (defined(__SVR4) || defined(sinix)) */ +#else /* ! (defined(__SVR4) || defind(sinix)) */ static int get_pty(int *master, int *slave) -- cgit 1.4.1