file system reorganization; pathnames.h
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 21 Apr 1989 03:08:09 +0000 (19:08 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 21 Apr 1989 03:08:09 +0000 (19:08 -0800)
SCCS-vsn: usr.bin/window/main.c 3.35
SCCS-vsn: usr.bin/window/local.h 3.9
SCCS-vsn: usr.bin/window/wwenviron.c 3.22

usr/src/usr.bin/window/local.h
usr/src/usr.bin/window/main.c
usr/src/usr.bin/window/wwenviron.c

index 25c7774..be0c976 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)local.h     3.8 (Berkeley) %G%
+ *     @(#)local.h     3.9 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -24,4 +24,3 @@
 #define RUNCOM         ".windowrc"
 #define ESCAPEC                ctrl('p')
 #define NLINE          48                      /* default text buffer size */
 #define RUNCOM         ".windowrc"
 #define ESCAPEC                ctrl('p')
 #define NLINE          48                      /* default text buffer size */
-#define SHELL          "/bin/sh"               /* if no environment SHELL */
index 1e9c188..9e4c2aa 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     3.34 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     3.35 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "defs.h"
 #endif /* not lint */
 
 #include "defs.h"
@@ -25,6 +25,7 @@ static char sccsid[] = "@(#)main.c    3.34 (Berkeley) %G%";
 #include "string.h"
 #include "char.h"
 #include "local.h"
 #include "string.h"
 #include "char.h"
 #include "local.h"
+#include "pathnames.h"
 
 #define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)usage()))
 
 
 #define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)usage()))
 
@@ -81,7 +82,7 @@ char **argv;
                        (void) usage();
        }
        if ((p = getenv("SHELL")) == 0)
                        (void) usage();
        }
        if ((p = getenv("SHELL")) == 0)
-               p = SHELL;
+               p = _PATH_BSHELL;
        if ((default_shellfile = str_cpy(p)) == 0)
                nomem();
        if (p = rindex(default_shellfile, '/'))
        if ((default_shellfile = str_cpy(p)) == 0)
                nomem();
        if (p = rindex(default_shellfile, '/'))
index 8e0f1c8..820452d 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)wwenviron.c        3.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)wwenviron.c        3.22 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "ww.h"
 #endif /* not lint */
 
 #include "ww.h"
@@ -29,14 +29,18 @@ wwenviron(wp)
 register struct ww *wp;
 {
        register i;
 register struct ww *wp;
 {
        register i;
+#ifndef TIOCSCTTY
        int pgrp = getpid();
        int pgrp = getpid();
+#endif
        char buf[1024];
 
        char buf[1024];
 
+#ifndef TIOCSCTTY
        if ((i = open("/dev/tty", 0)) < 0)
                goto bad;
        if (ioctl(i, TIOCNOTTY, (char *)0) < 0)
                goto bad;
        (void) close(i);
        if ((i = open("/dev/tty", 0)) < 0)
                goto bad;
        if (ioctl(i, TIOCNOTTY, (char *)0) < 0)
                goto bad;
        (void) close(i);
+#endif
        if ((i = wp->ww_socket) < 0) {
                if ((i = open(wp->ww_ttyname, 2)) < 0)
                        goto bad;
        if ((i = wp->ww_socket) < 0) {
                if ((i = open(wp->ww_ttyname, 2)) < 0)
                        goto bad;
@@ -48,8 +52,13 @@ register struct ww *wp;
        (void) dup2(i, 2);
        for (i = wwdtablesize - 1; i > 2; i--)
                (void) close(i);
        (void) dup2(i, 2);
        for (i = wwdtablesize - 1; i > 2; i--)
                (void) close(i);
+#ifdef TIOCSCTTY
+       (void) setsid(0);
+       (void) ioctl(0, TIOCSCTTY, 0);
+#else
        (void) ioctl(0, TIOCSPGRP, (char *)&pgrp);
        (void) setpgrp(pgrp, pgrp);
        (void) ioctl(0, TIOCSPGRP, (char *)&pgrp);
        (void) setpgrp(pgrp, pgrp);
+#endif
        /* SIGPIPE is the only one we ignore */
        (void) signal(SIGPIPE, SIG_DFL);
        (void) sigsetmask(0);
        /* SIGPIPE is the only one we ignore */
        (void) signal(SIGPIPE, SIG_DFL);
        (void) sigsetmask(0);