new copyright & pathnames (talkd)
[unix-history] / usr / src / libexec / talkd / process.c
index a325ebf..810d863 100644 (file)
@@ -2,21 +2,11 @@
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1983 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * %sccs.include.redist.c%
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)process.c  5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)process.c  5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -35,6 +25,7 @@ static char sccsid[] = "@(#)process.c 5.6 (Berkeley) %G%";
 #include <netinet/in.h>
 
 #include <protocols/talkd.h>
 #include <netinet/in.h>
 
 #include <protocols/talkd.h>
+#include <paths.h>
 
 char   *strcpy();
 CTL_MSG *find_request();
 
 char   *strcpy();
 CTL_MSG *find_request();
@@ -167,13 +158,13 @@ find_user(name, tty)
        struct stat statb;
        char ftty[20];
 
        struct stat statb;
        char ftty[20];
 
-       if ((fd = fopen("/etc/utmp", "r")) == NULL) {
-               perror("Can't open /etc/utmp");
+       if ((fd = fopen(_PATH_UTMP, "r")) == NULL) {
+               fprintf(stderr, "talkd: can't read %s.\n", _PATH_UTMP);
                return (FAILED);
        }
 #define SCMPN(a, b)    strncmp(a, b, sizeof (a))
        status = NOT_HERE;
                return (FAILED);
        }
 #define SCMPN(a, b)    strncmp(a, b, sizeof (a))
        status = NOT_HERE;
-       (void) strcpy(ftty, "/dev/");
+       (void) strcpy(ftty, _PATH_DEV);
        while (fread((char *) &ubuf, sizeof ubuf, 1, fd) == 1)
                if (SCMPN(ubuf.ut_name, name) == 0) {
                        if (*tty == '\0') {
        while (fread((char *) &ubuf, sizeof ubuf, 1, fd) == 1)
                if (SCMPN(ubuf.ut_name, name) == 0) {
                        if (*tty == '\0') {