From ee461acc1a024bd51a3936790b1cb452534bf2db Mon Sep 17 00:00:00 2001 From: Philippe Charnier Date: Mon, 4 Aug 1997 06:48:25 +0000 Subject: [PATCH] Use err(3). Use #include "" instead of <> for local headers. --- usr.bin/ranlib/build.c | 5 ++++- usr.bin/ranlib/misc.c | 10 +++++++--- usr.bin/ranlib/ranlib.1 | 6 +++--- usr.bin/ranlib/ranlib.1aout | 6 +++--- usr.bin/ranlib/ranlib.5 | 4 ++-- usr.bin/ranlib/ranlib.c | 15 ++++++++++----- usr.bin/ranlib/touch.c | 20 ++++++++++++-------- 7 files changed, 41 insertions(+), 25 deletions(-) diff --git a/usr.bin/ranlib/build.c b/usr.bin/ranlib/build.c index 3b70630c579..eedb7215d08 100644 --- a/usr.bin/ranlib/build.c +++ b/usr.bin/ranlib/build.c @@ -35,11 +35,14 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)build.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include -#include #include #include diff --git a/usr.bin/ranlib/misc.c b/usr.bin/ranlib/misc.c index 600e49eff8b..97e970de114 100644 --- a/usr.bin/ranlib/misc.c +++ b/usr.bin/ranlib/misc.c @@ -35,17 +35,22 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include #include +#include #include -#include #include #include #include #include +#include #include "pathnames.h" extern char *archive; /* archive name */ @@ -105,6 +110,5 @@ void error(name) char *name; { - (void)fprintf(stderr, "ranlib: %s: %s\n", name, strerror(errno)); - exit(1); + err(1, "%s", name); } diff --git a/usr.bin/ranlib/ranlib.1 b/usr.bin/ranlib/ranlib.1 index bb419d6c5d9..2d37924b766 100644 --- a/usr.bin/ranlib/ranlib.1 +++ b/usr.bin/ranlib/ranlib.1 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)ranlib.1 8.1 (Berkeley) 6/6/93 -.\" $Id$ +.\" $Id: ranlib.1,v 1.5 1997/02/22 19:56:39 peter Exp $ .\" .Dd June 6, 1993 .Dt RANLIB 1 @@ -39,7 +39,7 @@ .Nm ranlib .Nd table-of-contents for archive libraries .Sh SYNOPSIS -.Nm ranlib +.Nm .Op Fl t .Ar file ... .Sh DESCRIPTION @@ -84,6 +84,6 @@ Temporary file names. .Xr ranlib 5 .Sh HISTORY A -.Nm ranlib +.Nm command appeared in .At v7 . diff --git a/usr.bin/ranlib/ranlib.1aout b/usr.bin/ranlib/ranlib.1aout index bb419d6c5d9..2d37924b766 100644 --- a/usr.bin/ranlib/ranlib.1aout +++ b/usr.bin/ranlib/ranlib.1aout @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)ranlib.1 8.1 (Berkeley) 6/6/93 -.\" $Id$ +.\" $Id: ranlib.1,v 1.5 1997/02/22 19:56:39 peter Exp $ .\" .Dd June 6, 1993 .Dt RANLIB 1 @@ -39,7 +39,7 @@ .Nm ranlib .Nd table-of-contents for archive libraries .Sh SYNOPSIS -.Nm ranlib +.Nm .Op Fl t .Ar file ... .Sh DESCRIPTION @@ -84,6 +84,6 @@ Temporary file names. .Xr ranlib 5 .Sh HISTORY A -.Nm ranlib +.Nm command appeared in .At v7 . diff --git a/usr.bin/ranlib/ranlib.5 b/usr.bin/ranlib/ranlib.5 index e953c51056d..132d2814fae 100644 --- a/usr.bin/ranlib/ranlib.5 +++ b/usr.bin/ranlib/ranlib.5 @@ -41,7 +41,7 @@ .Fd #include .Sh DESCRIPTION The archive table-of-contents command -.Nm ranlib +.Nm creates a table of contents for archives, containing object files, to be used by the link-editor .Xr ld 1 . @@ -49,7 +49,7 @@ It operates on archives created with the utility .Xr ar 1 . .Pp The -.Nm Ranlib +.Nm function prepends a new file to the archive which has three separate parts. The first part is a standard archive header, which has a special name diff --git a/usr.bin/ranlib/ranlib.c b/usr.bin/ranlib/ranlib.c index d58a4cf4367..0b60eb1c68c 100644 --- a/usr.bin/ranlib/ranlib.c +++ b/usr.bin/ranlib/ranlib.c @@ -35,24 +35,29 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1990, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)ranlib.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include #include #include #include -#include +#include +#include "archive.h" extern int build __P(( void )); extern int touch __P(( void )); -void usage __P((void)); +static void usage __P((void)); CHDR chdr; u_int options; /* UNUSED -- keep open_archive happy */ @@ -87,8 +92,8 @@ main(argc, argv) exit(eval); } -void -usage(void) +static void +usage() { (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n"); exit(1); diff --git a/usr.bin/ranlib/touch.c b/usr.bin/ranlib/touch.c index 68a86a4bf86..93670b39b69 100644 --- a/usr.bin/ranlib/touch.c +++ b/usr.bin/ranlib/touch.c @@ -35,19 +35,24 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)touch.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include -#include -#include -#include #include -#include -#include +#include +#include +#include +#include #include #include -#include +#include +#include +#include "archive.h" extern CHDR chdr; /* converted header */ extern char *archive; /* archive name */ @@ -65,8 +70,7 @@ touch(void) if (!get_arobj(afd) || strncmp(RANLIBMAG, chdr.name, sizeof(RANLIBMAG) - 1)) { - (void)fprintf(stderr, - "ranlib: %s: no symbol table.\n", archive); + warnx("%s: no symbol table", archive); return(1); } settime(afd);