ANSI fixes (one real bug!)
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 27 Feb 1991 06:53:15 +0000 (22:53 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Wed, 27 Feb 1991 06:53:15 +0000 (22:53 -0800)
SCCS-vsn: usr.bin/ranlib/build.c 5.2
SCCS-vsn: usr.bin/ranlib/misc.c 5.2
SCCS-vsn: usr.bin/ranlib/ranlib.c 5.6
SCCS-vsn: usr.bin/ranlib/touch.c 5.2

usr/src/usr.bin/ranlib/build.c
usr/src/usr.bin/ranlib/misc.c
usr/src/usr.bin/ranlib/ranlib.c
usr/src/usr.bin/ranlib/touch.c

index 790aedc..e6a1bc5 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)build.c    5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)build.c    5.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -37,6 +37,7 @@ typedef struct _rlib {
 RLIB *rhead, **pnext;
 
 FILE *fp;
 RLIB *rhead, **pnext;
 
 FILE *fp;
+static void rexec(), symobj();
 
 build()
 {
 
 build()
 {
@@ -88,7 +89,7 @@ long tsymlen;                         /* total string length */
  *     Read the exec structure; ignore any files that don't look
  *     exactly right.
  */
  *     Read the exec structure; ignore any files that don't look
  *     exactly right.
  */
-static
+static void
 rexec(rfd, wfd)
        register int rfd;
        int wfd;
 rexec(rfd, wfd)
        register int rfd;
        int wfd;
@@ -186,7 +187,7 @@ bad1:       (void)lseek(rfd, (off_t)r_off, SEEK_SET);
  *     Write the symbol table into the archive, computing offsets as
  *     writing.
  */
  *     Write the symbol table into the archive, computing offsets as
  *     writing.
  */
-static
+static void
 symobj()
 {
        register RLIB *rp;
 symobj()
 {
        register RLIB *rp;
@@ -212,7 +213,7 @@ symobj()
        /* Put out the ranlib archive file header. */
 #define        DEFMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
        (void)sprintf(hb, HDR2, RANLIBMAG, 0L, getuid(), getgid(),
        /* Put out the ranlib archive file header. */
 #define        DEFMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
        (void)sprintf(hb, HDR2, RANLIBMAG, 0L, getuid(), getgid(),
-           DEFMODE & ~umask(), ransize, ARFMAG);
+           DEFMODE & ~umask(0), ransize, ARFMAG);
        if (!fwrite(hb, sizeof(struct ar_hdr), 1, fp))
                error(tname);
 
        if (!fwrite(hb, sizeof(struct ar_hdr), 1, fp))
                error(tname);
 
index 2ba64c9..0d955b3 100644 (file)
@@ -9,12 +9,13 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/signal.h>
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/signal.h>
-#include <sys/errno.h>
+#include <errno.h>
+#include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 00da536..7f06833 100644 (file)
@@ -15,12 +15,13 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)ranlib.c   5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)ranlib.c   5.6 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <dirent.h>
 #include <stdio.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <dirent.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <archive.h>
 
 CHDR chdr;
 #include <archive.h>
 
 CHDR chdr;
index 742a40e..7cc4d42 100644 (file)
@@ -9,18 +9,19 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)touch.c    5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)touch.c    5.2 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <fcntl.h>
 #endif /* not lint */
 
 #include <sys/types.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include <dirent.h>
 #include <ranlib.h>
 #include <ar.h>
 #include <dirent.h>
 #include <ranlib.h>
 #include <ar.h>
+#include <time.h>
+#include <unistd.h>
 #include <stdio.h>
 #include <stdio.h>
+#include <string.h>
 #include <archive.h>
 #include <archive.h>
-#include <time.h>
 
 extern CHDR chdr;                      /* converted header */
 extern char *archive;                  /* archive name */
 
 extern CHDR chdr;                      /* converted header */
 extern char *archive;                  /* archive name */