update from main archive 961126
authordrepper <drepper>
Wed, 27 Nov 1996 06:09:26 +0000 (06:09 +0000)
committerdrepper <drepper>
Wed, 27 Nov 1996 06:09:26 +0000 (06:09 +0000)
sysdeps/generic/paths.h
sysdeps/generic/pty.c

index a2ff426..e5f3401 100644 (file)
@@ -62,6 +62,7 @@
 #define        _PATH_TTY       "/dev/tty"
 #define        _PATH_UNIX      "/vmunix"
 #define        _PATH_UTMP      "/var/run/utmp"
+#define        _PATH_UTMP_DB   "/var/run/utmp.db"
 #define        _PATH_VI        "/usr/bin/vi"
 #define        _PATH_WTMP      "/var/log/wtmp"
 
index 8df8aba..660602b 100644 (file)
@@ -59,9 +59,12 @@ openpty(amaster, aslave, name, termp, winp)
        static char line[] = "/dev/ptyXX";
        register const char *cp1, *cp2;
        register int master, slave, ttygid;
+       size_t buflen = sysconf (_SC_GETGR_R_SIZE_MAX);
+       char buffer[buflen];
+       struct group grbuffer;
        struct group *gr;
 
-       if ((gr = getgrnam("tty")) != NULL)
+       if (getgrnam_r("tty", &grbuffer, buffer, buflen, &gr) >= 0)
                ttygid = gr->gr_gid;
        else
                ttygid = -1;