about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-03-25 18:07:38 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-03-25 18:07:38 +0000
commit3a69ea87be4023e93c0ee317e627e72201fac8c7 (patch)
tree33d8a33ce386c0193f9b1da42d73d74ad505762f
parent7e2d72fff45836860a86550e1a98c800bede1eb8 (diff)
downloadzsh-3a69ea87be4023e93c0ee317e627e72201fac8c7.tar.gz
zsh-3a69ea87be4023e93c0ee317e627e72201fac8c7.tar.xz
zsh-3a69ea87be4023e93c0ee317e627e72201fac8c7.zip
zsh-workers/10243
-rw-r--r--Completion/User/_groups3
-rw-r--r--Src/Modules/zpty.c43
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: :)$(</etc/group)}%%:*}}
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 63135c31b..26896525c 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -165,7 +165,7 @@ get_pty(int *master, int *slave)
 
 #else /* ! __osf__ */
 
-#if __SVR4
+#if defined(__SVR4) || defined(sinix)
 
 #include <sys/stropts.h>
 
@@ -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)