=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/strip/Attic/strip.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- src/usr.bin/strip/Attic/strip.c 1997/01/15 23:43:15 1.6 +++ src/usr.bin/strip/Attic/strip.c 1997/02/09 16:37:13 1.7 @@ -1,4 +1,4 @@ -/* $OpenBSD: strip.c,v 1.6 1997/01/15 23:43:15 millert Exp $ */ +/* $OpenBSD: strip.c,v 1.7 1997/02/09 16:37:13 mickey Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -41,7 +41,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)strip.c 5.8 (Berkeley) 11/6/91";*/ -static char rcsid[] = "$OpenBSD: strip.c,v 1.6 1997/01/15 23:43:15 millert Exp $"; +static char rcsid[] = "$OpenBSD: strip.c,v 1.7 1997/02/09 16:37:13 mickey Exp $"; #endif /* not lint */ #include @@ -55,13 +55,13 @@ #include #include #include +#include typedef struct exec EXEC; typedef struct nlist NLIST; #define strx n_un.n_strx -void err __P((const char *fmt, ...)); int s_stab __P((const char *, int, EXEC *, struct stat *)); int s_sym __P((const char *, int, EXEC *, struct stat *)); void usage __P((void)); @@ -96,7 +96,7 @@ argv += optind; errors = 0; -#define ERROR(x) errors |= 1; err("%s: %s", fn, strerror(x)); continue; +#define ERROR(x) errors |= 1; warn(fn); continue; while (fn = *argv++) { if ((fd = open(fn, O_RDWR)) < 0) { ERROR(errno); @@ -193,7 +193,7 @@ /* Truncate the file. */ if (ftruncate(fd, neweof - (char *)ep)) { - err("%s: %s", fn, strerror(errno)); + warn(fn); return 1; } @@ -217,7 +217,7 @@ return 0; if (N_SYMOFF(*ep) >= sp->st_size) { - err("%s: bad symbol table", fn); + warnx("%s: bad symbol table", fn); return 1; } @@ -235,7 +235,7 @@ */ strbase = (char *)ep + N_STROFF(*ep); if ((nstrbase = malloc((u_int)*(u_long *)strbase)) == NULL) { - err("%s", strerror(ENOMEM)); + warnx("%s", strerror(ENOMEM)); return 1; } nstr = nstrbase + sizeof(u_long); @@ -279,7 +279,7 @@ /* Truncate to the current length. */ if (ftruncate(fd, (char *)nsym + len - (char *)ep)) { - err("%s: %s", fn, strerror(errno)); + warn(fn); return 1; } @@ -293,29 +293,3 @@ exit(1); } -#if __STDC__ -#include -#else -#include -#endif - -void -#if __STDC__ -err(const char *fmt, ...) -#else -err(fmt, va_alist) - char *fmt; - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - (void)fprintf(stderr, "strip: "); - (void)vfprintf(stderr, fmt, ap); - va_end(ap); - (void)fprintf(stderr, "\n"); -}