diff options
author | charnier <charnier@FreeBSD.org> | 1997-08-04 06:48:25 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-08-04 06:48:25 +0000 |
commit | ba2544a6f0b91693130f57914790cc17ca424abf (patch) | |
tree | c45d08afc552bbe8240896d9499de1b331b9990e /usr.bin | |
parent | e7d0804666a37dfc6f4cdf20a24624f300e5bf9e (diff) | |
download | FreeBSD-src-ba2544a6f0b91693130f57914790cc17ca424abf.zip FreeBSD-src-ba2544a6f0b91693130f57914790cc17ca424abf.tar.gz |
Use err(3). Use #include "" instead of <> for local headers.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ranlib/build.c | 5 | ||||
-rw-r--r-- | usr.bin/ranlib/misc.c | 10 | ||||
-rw-r--r-- | usr.bin/ranlib/ranlib.1 | 6 | ||||
-rw-r--r-- | usr.bin/ranlib/ranlib.1aout | 6 | ||||
-rw-r--r-- | usr.bin/ranlib/ranlib.5 | 4 | ||||
-rw-r--r-- | usr.bin/ranlib/ranlib.c | 15 | ||||
-rw-r--r-- | usr.bin/ranlib/touch.c | 18 |
7 files changed, 40 insertions, 24 deletions
diff --git a/usr.bin/ranlib/build.c b/usr.bin/ranlib/build.c index 3b70630..eedb721 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 <sys/types.h> -#include <sys/errno.h> #include <sys/stat.h> #include <a.out.h> diff --git a/usr.bin/ranlib/misc.c b/usr.bin/ranlib/misc.c index 600e49e..97e970d 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 <sys/param.h> #include <sys/signal.h> +#include <err.h> #include <errno.h> -#include <unistd.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #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 bb419d6..2d37924 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 bb419d6..2d37924 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 e953c51..132d281 100644 --- a/usr.bin/ranlib/ranlib.5 +++ b/usr.bin/ranlib/ranlib.5 @@ -41,7 +41,7 @@ .Fd #include <ranlib.h> .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 d58a4cf..0b60eb1 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 <sys/types.h> #include <dirent.h> #include <stdio.h> #include <stdlib.h> -#include <archive.h> +#include <unistd.h> +#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 68a86a4..93670b3 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 <sys/types.h> -#include <fcntl.h> +#include <ar.h> #include <dirent.h> +#include <err.h> +#include <fcntl.h> #include <ranlib.h> -#include <ar.h> -#include <time.h> -#include <unistd.h> #include <stdio.h> #include <string.h> -#include <archive.h> +#include <time.h> +#include <unistd.h> +#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); |