gtty and utime are in compatibility library now
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 20 May 1989 09:22:42 +0000 (01:22 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 20 May 1989 09:22:42 +0000 (01:22 -0800)
SCCS-vsn: usr.bin/mail/aux.c 5.17
SCCS-vsn: usr.bin/mail/main.c 5.24
SCCS-vsn: usr.bin/mail/tty.c 5.9

usr/src/usr.bin/mail/aux.c
usr/src/usr.bin/mail/main.c
usr/src/usr.bin/mail/tty.c

index c80c5f3..17c568f 100644 (file)
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)aux.c      5.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)aux.c      5.17 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "rcv.h"
 #include <sys/stat.h>
 #endif /* not lint */
 
 #include "rcv.h"
 #include <sys/stat.h>
+#include <sys/time.h>
 
 /*
  * Mail -- a mail program
 
 /*
  * Mail -- a mail program
@@ -298,17 +299,18 @@ unstack()
  * This is nifty for the shell.
  */
 alter(name)
  * This is nifty for the shell.
  */
 alter(name)
-       char name[];
+       char *name;
 {
 {
-       struct stat statb;
-       long time();
-       time_t time_p[2];
+       struct stat sb;
+       struct timeval tv[2];
+       time_t time();
 
 
-       if (stat(name, &statb) < 0)
+       if (stat(name, &sb))
                return;
                return;
-       time_p[0] = time((long *) 0) + 1;
-       time_p[1] = statb.st_mtime;
-       utime(name, time_p);
+       tv[0].tv_sec = time((time_t *)0) + 1;
+       tv[1].tv_sec = sb.st_mtime;
+       tv[0].tv_usec = tv[1].tv_usec = 0;
+       (void)utimes(name, tv);
 }
 
 /*
 }
 
 /*
index d9ad0c6..e3b2766 100644 (file)
@@ -22,7 +22,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.23 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.24 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "rcv.h"
 #endif /* not lint */
 
 #include "rcv.h"
@@ -258,7 +258,7 @@ setscreensize()
 
        if (ioctl(1, TIOCGWINSZ, (char *) &ws) < 0)
                ws.ws_col = ws.ws_row = 0;
 
        if (ioctl(1, TIOCGWINSZ, (char *) &ws) < 0)
                ws.ws_col = ws.ws_row = 0;
-       if (gtty(1, &tbuf) < 0)
+       if (ioctl(1, TIOCGETP, &tbuf) < 0)
                tbuf.sg_ospeed = B9600;
        if (tbuf.sg_ospeed < B1200)
                screenheight = 9;
                tbuf.sg_ospeed = B9600;
        if (tbuf.sg_ospeed < B1200)
                screenheight = 9;
index 887f7c3..7099a30 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)tty.c      5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)tty.c      5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -60,7 +60,7 @@ grabh(hp, gflags)
 #ifndef TIOCSTI
        ttyset = 0;
 #endif
 #ifndef TIOCSTI
        ttyset = 0;
 #endif
-       if (gtty(fileno(stdin), &ttybuf) < 0) {
+       if (ioctl(fileno(stdin), TIOCGETP, &ttybuf) < 0) {
                perror("gtty");
                return(-1);
        }
                perror("gtty");
                return(-1);
        }