=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/script/script.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/script/script.c 2004/09/14 23:53:07 1.20 --- src/usr.bin/script/script.c 2004/10/10 03:59:04 1.21 *************** *** 1,4 **** ! /* $OpenBSD: script.c,v 1.20 2004/09/14 23:53:07 deraadt Exp $ */ /* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: script.c,v 1.21 2004/10/10 03:59:04 mickey Exp $ */ /* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */ /* *************** *** 56,71 **** */ #ifndef lint ! static char copyright[] = "@(#) Copyright (c) 1980, 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint #if 0 ! static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: script.c,v 1.20 2004/09/14 23:53:07 deraadt Exp $"; #endif /* not lint */ #include --- 56,71 ---- */ #ifndef lint ! static const char copyright[] = "@(#) Copyright (c) 1980, 1992, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint #if 0 ! static const char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93"; #endif ! static const char rcsid[] = "$OpenBSD: script.c,v 1.21 2004/10/10 03:59:04 mickey Exp $"; #endif /* not lint */ #include *************** *** 111,116 **** --- 111,117 ---- int main(int argc, char *argv[]) { + extern char *__progname; struct sigaction sa; struct termios rtt; struct winsize win; *************** *** 125,131 **** aflg = 1; break; default: ! (void)fprintf(stderr, "usage: script [-a] [file]\n"); exit(1); } argc -= optind; --- 126,132 ---- aflg = 1; break; default: ! fprintf(stderr, "usage: %s [-a] [file]\n", __progname); exit(1); } argc -= optind; *************** *** 161,173 **** child = fork(); if (child < 0) { ! perror("fork"); fail(); } if (child == 0) { subchild = child = fork(); if (child < 0) { ! perror("fork"); fail(); } if (child) --- 162,174 ---- child = fork(); if (child < 0) { ! warn("fork"); fail(); } if (child == 0) { subchild = child = fork(); if (child < 0) { ! warn("fork"); fail(); } if (child) *************** *** 299,305 **** (void)fclose(fscript); login_tty(slave); execl(shell, shell, "-i", (char *)NULL); ! perror(shell); fail(); } --- 300,306 ---- (void)fclose(fscript); login_tty(slave); execl(shell, shell, "-i", (char *)NULL); ! warn("%s", shell); fail(); }