=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/talk/get_names.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/talk/get_names.c 1998/04/28 22:13:25 1.5 --- src/usr.bin/talk/get_names.c 1998/08/18 04:02:13 1.6 *************** *** 1,4 **** ! /* $OpenBSD: get_names.c,v 1.5 1998/04/28 22:13:25 pjanzen Exp $ */ /* $NetBSD: get_names.c,v 1.4 1994/12/09 02:14:16 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: get_names.c,v 1.6 1998/08/18 04:02:13 millert Exp $ */ /* $NetBSD: get_names.c,v 1.4 1994/12/09 02:14:16 jtc Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: get_names.c,v 1.5 1998/04/28 22:13:25 pjanzen Exp $"; #endif /* not lint */ #include "talk.h" --- 38,44 ---- #if 0 static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: get_names.c,v 1.6 1998/08/18 04:02:13 millert Exp $"; #endif /* not lint */ #include "talk.h" *************** *** 64,85 **** char *names; if ((argc < 2 ) || ('@' == argv[1][0])) { ! printf("Usage: talk user [ttyname]\n"); ! printf(" talk user@hostname [ttyname]\n"); exit(-1); } ! if (!isatty(0)) { ! printf("Standard input must be a tty, not a pipe or a file\n"); ! exit(-1); ! } if ((my_name = getlogin()) == NULL) { struct passwd *pw; ! if ((pw = getpwuid(getuid())) == NULL) { ! printf("You don't exist. Go away.\n"); ! exit(-1); ! } my_name = pw->pw_name; } gethostname(hostname, sizeof (hostname)); --- 64,81 ---- char *names; if ((argc < 2 ) || ('@' == argv[1][0])) { ! fprintf(stderr, "usage: talk user [ttyname]\n" ! " talk user@hostname [ttyname]\n"); exit(-1); } ! if (!isatty(0)) ! errx(1, "standard input must be a tty, not a pipe or a file"); if ((my_name = getlogin()) == NULL) { struct passwd *pw; ! if ((pw = getpwuid(getuid())) == NULL) ! errx(1, "you don't exist in the passwd file."); my_name = pw->pw_name; } gethostname(hostname, sizeof (hostname));