]> andersk Git - moira.git/commitdiff
compile on AUX
authormar <mar>
Fri, 4 Jan 1991 16:57:26 +0000 (16:57 +0000)
committermar <mar>
Fri, 4 Jan 1991 16:57:26 +0000 (16:57 +0000)
clients/moira/menu.c

index 795c69162ae00b5ed61cbc23f3a9e774e51d0ec6..892e3db881a6c07890bd86a73e92d50c0faea6f5 100644 (file)
@@ -27,6 +27,10 @@ static char rcsid_menu_c[] = "$Header$";
 #include <stdio.h>
 #include <signal.h>
 #include <curses.h>
+#ifdef _AUX_SOURCE
+#include <sys/termio.h>
+#include <sys/ttychars.h>
+#endif /* _AUX_SOURCE */
 #include <ctype.h>
 #include <strings.h>
 #include <varargs.h>
@@ -589,9 +593,26 @@ int Password_input(prompt, buf, buflen)
        }
     }
     else {
+#ifdef _AUX_SOURCE
+       struct termio ttybuf, nttybuf;
+#else
        struct sgttyb ttybuf, nttybuf;
+#endif /* _AUX_SOURCE */
        printf("%s", prompt);
        /* turn off echoing */
+#ifdef _AUX_SOURCE
+       (void) ioctl(0, TCGETA, (char *)&ttybuf);
+       nttybuf = ttybuf;
+       nttybuf.c_lflag &= ~ECHO;
+       (void)ioctl(0, TCSETA, (char *)&nttybuf);
+       if (gets(buf) == NULL) {
+           (void) ioctl(0, TCSETA, (char *)&ttybuf);
+           putchar('\n');
+           return 0;
+       }
+       putchar('\n');
+       (void) ioctl(0, TCSETA, (char *)&ttybuf);
+#else
        (void) ioctl(0, TIOCGETP, (char *)&ttybuf);
        nttybuf = ttybuf;
        nttybuf.sg_flags &= ~ECHO;
@@ -603,6 +624,7 @@ int Password_input(prompt, buf, buflen)
        }
        putchar('\n');
        (void) ioctl(0, TIOCSETP, (char *)&ttybuf);
+#endif /* _AUX_SOURCE */
        Start_paging();
        return 1;
     }
This page took 0.039496 seconds and 5 git commands to generate.