summaryrefslogtreecommitdiffstats
path: root/sbin/dump
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-03-20 22:49:40 +0000
committerimp <imp@FreeBSD.org>2002-03-20 22:49:40 +0000
commit69763106f0fd2b6bc5d1d93ba49d88ca38ea3c56 (patch)
tree07ff12515683ef4e24a284e242c874bd8b92d427 /sbin/dump
parent2e58ec02712d7b8dffd130dacaad2ad7c24c592b (diff)
downloadFreeBSD-src-69763106f0fd2b6bc5d1d93ba49d88ca38ea3c56.zip
FreeBSD-src-69763106f0fd2b6bc5d1d93ba49d88ca38ea3c56.tar.gz
o remove __P
o Use ANSI function definitions o unifdef -D__STDC__
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/dump.h92
-rw-r--r--sbin/dump/dumprmt.c91
-rw-r--r--sbin/dump/itime.c37
-rw-r--r--sbin/dump/main.c33
-rw-r--r--sbin/dump/optr.c68
-rw-r--r--sbin/dump/tape.c66
-rw-r--r--sbin/dump/traverse.c72
-rw-r--r--sbin/dump/unctime.c5
8 files changed, 155 insertions, 309 deletions
diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h
index e3cc7c2..f9a7234 100644
--- a/sbin/dump/dump.h
+++ b/sbin/dump/dump.h
@@ -90,58 +90,54 @@ long dev_bsize; /* block size of underlying disk device */
int dev_bshift; /* log2(dev_bsize) */
int tp_bshift; /* log2(TP_BSIZE) */
-#ifndef __P
-#include <sys/cdefs.h>
-#endif
-
/* operator interface functions */
-void broadcast __P((char *message));
-void infosch __P((int));
-void lastdump __P((int arg)); /* int should be char */
-void msg __P((const char *fmt, ...)) __printflike(1, 2);
-void msgtail __P((const char *fmt, ...)) __printflike(1, 2);
-int query __P((char *question));
-void quit __P((const char *fmt, ...)) __printflike(1, 2);
-void timeest __P((void));
-time_t unctime __P((char *str));
+void broadcast(const char *message);
+void infosch(int);
+void lastdump(int arg); /* int should be char */
+void msg(const char *fmt, ...) __printflike(1, 2);
+void msgtail(const char *fmt, ...) __printflike(1, 2);
+int query(const char *question);
+void quit(const char *fmt, ...) __printflike(1, 2);
+void timeest(void);
+time_t unctime(char *str);
/* mapping rouintes */
struct dinode;
-long blockest __P((struct dinode *dp));
-int mapfiles __P((ino_t maxino, long *tapesize));
-int mapdirs __P((ino_t maxino, long *tapesize));
+long blockest(struct dinode *dp);
+int mapfiles(ino_t maxino, long *tapesize);
+int mapdirs(ino_t maxino, long *tapesize);
/* file dumping routines */
-void blksout __P((daddr_t *blkp, int frags, ino_t ino));
-void bread __P((daddr_t blkno, char *buf, int size));
-void dumpino __P((struct dinode *dp, ino_t ino));
-void dumpmap __P((char *map, int type, ino_t ino));
-void writeheader __P((ino_t ino));
+void blksout(daddr_t *blkp, int frags, ino_t ino);
+void bread(daddr_t blkno, char *buf, int size);
+void dumpino(struct dinode *dp, ino_t ino);
+void dumpmap(char *map, int type, ino_t ino);
+void writeheader(ino_t ino);
/* tape writing routines */
-int alloctape __P((void));
-void close_rewind __P((void));
-void dumpblock __P((daddr_t blkno, int size));
-void startnewtape __P((int top));
-void trewind __P((void));
-void writerec __P((char *dp, int isspcl));
+int alloctape(void);
+void close_rewind(void);
+void dumpblock(daddr_t blkno, int size);
+void startnewtape(int top);
+void trewind(void);
+void writerec(char *dp, int isspcl);
-void Exit __P((int status)) __dead2;
-void dumpabort __P((int signo));
-void getfstab __P((void));
+void Exit(int status) __dead2;
+void dumpabort(int signo);
+void getfstab(void);
-char *rawname __P((char *cp));
-struct dinode *getino __P((ino_t inum));
+char *rawname(char *cp);
+struct dinode *getino(ino_t inum);
/* rdump routines */
#ifdef RDUMP
-void rmtclose __P((void));
-int rmthost __P((char *host));
-int rmtopen __P((char *tape, int mode));
-int rmtwrite __P((char *buf, int count));
+void rmtclose(void);
+int rmthost(const char *host);
+int rmtopen(const char *tape, int mode);
+int rmtwrite(const char *buf, int count);
#endif /* RDUMP */
-void interrupt __P((int signo)); /* in case operator bangs on console */
+void interrupt(int signo); /* in case operator bangs on console */
/*
* Exit status codes
@@ -153,7 +149,7 @@ void interrupt __P((int signo)); /* in case operator bangs on console */
#define OPGRENT "operator" /* group entry to notify */
-struct fstab *fstabsearch __P((char *key)); /* search fs_file and fs_spec */
+struct fstab *fstabsearch(const char *key); /* search fs_file and fs_spec */
#ifndef NAME_MAX
#define NAME_MAX 255
@@ -171,25 +167,13 @@ struct dumpdates {
int nddates; /* number of records (might be zero) */
int ddates_in; /* we have read the increment file */
struct dumpdates **ddatev; /* the arrayfied version */
-void initdumptimes __P((void));
-void getdumptime __P((void));
-void putdumptime __P((void));
+void initdumptimes(void);
+void getdumptime(void);
+void putdumptime(void);
#define ITITERATE(i, ddp) \
for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
-void sig __P((int signo));
-
-/*
- * Compatibility with old systems.
- */
-#ifdef COMPAT
-#include <sys/file.h>
-#define strchr(a,b) index(a,b)
-#define strrchr(a,b) rindex(a,b)
-extern char *strdup(), *ctime();
-extern int read(), write();
-extern int errno;
-#endif
+void sig(int signo);
#ifndef _PATH_UTMP
#define _PATH_UTMP "/etc/utmp"
diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c
index c424903..11531fb 100644
--- a/sbin/dump/dumprmt.c
+++ b/sbin/dump/dumprmt.c
@@ -57,12 +57,10 @@ static const char rcsid[] =
#include <netdb.h>
#include <pwd.h>
#include <stdio.h>
-#ifdef __STDC__
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#endif
#include "pathnames.h"
#include "dump.h"
@@ -74,15 +72,15 @@ static int rmtstate = TS_CLOSED;
static int rmtape;
static char *rmtpeer;
-static int okname __P((char *));
-static int rmtcall __P((char *, char *));
-static void rmtconnaborted __P((/* int, int */));
-static int rmtgetb __P((void));
-static void rmtgetconn __P((void));
-static void rmtgets __P((char *, int));
-static int rmtreply __P((char *));
+static int okname(const char *);
+static int rmtcall(const char *, const char *);
+static void rmtconnaborted(int);
+static int rmtgetb(void);
+static void rmtgetconn(void);
+static void rmtgets(char *, int);
+static int rmtreply(const char *);
#ifdef KERBEROS
-int krcmd __P((char **, int /*u_short*/, char *, char *, int *, char *));
+int krcmd(char **, int /*u_short*/, char *, char *, int *, char *);
#endif
static int errfd = -1;
@@ -90,15 +88,12 @@ extern int dokerberos;
extern int ntrec; /* blocking factor on tape */
int
-rmthost(host)
- char *host;
+rmthost(const char *host)
{
- rmtpeer = malloc(strlen(host) + 1);
- if (rmtpeer)
- strcpy(rmtpeer, host);
- else
- rmtpeer = host;
+ rmtpeer = strdup(host);
+ if (rmtpeer == NULL)
+ return (0);
signal(SIGPIPE, rmtconnaborted);
rmtgetconn();
if (rmtape < 0)
@@ -107,7 +102,7 @@ rmthost(host)
}
static void
-rmtconnaborted()
+rmtconnaborted(int sig __unused)
{
msg("Lost connection to remote host.\n");
if (errfd != -1) {
@@ -134,7 +129,7 @@ rmtconnaborted()
}
void
-rmtgetconn()
+rmtgetconn(void)
{
char *cp;
const char *rmt;
@@ -201,10 +196,9 @@ rmtgetconn()
}
static int
-okname(cp0)
- char *cp0;
+okname(const char *cp0)
{
- char *cp;
+ const char *cp;
int c;
for (cp = cp0; *cp; cp++) {
@@ -218,9 +212,7 @@ okname(cp0)
}
int
-rmtopen(tape, mode)
- char *tape;
- int mode;
+rmtopen(const char *tape, int mode)
{
char buf[256];
@@ -230,7 +222,7 @@ rmtopen(tape, mode)
}
void
-rmtclose()
+rmtclose(void)
{
if (rmtstate != TS_OPEN)
@@ -240,9 +232,7 @@ rmtclose()
}
int
-rmtread(buf, count)
- char *buf;
- int count;
+rmtread(char *buf, int count)
{
char line[30];
int n, i, cc;
@@ -255,15 +245,13 @@ rmtread(buf, count)
for (i = 0; i < n; i += cc) {
cc = read(rmtape, buf+i, n - i);
if (cc <= 0)
- rmtconnaborted();
+ rmtconnaborted(0);
}
return (n);
}
int
-rmtwrite(buf, count)
- char *buf;
- int count;
+rmtwrite(const char *buf, int count)
{
char line[30];
@@ -274,8 +262,7 @@ rmtwrite(buf, count)
}
void
-rmtwrite0(count)
- int count;
+rmtwrite0(int count)
{
char line[30];
@@ -284,24 +271,21 @@ rmtwrite0(count)
}
void
-rmtwrite1(buf, count)
- char *buf;
- int count;
+rmtwrite1(const char *buf, int count)
{
write(rmtape, buf, count);
}
int
-rmtwrite2()
+rmtwrite2(void)
{
return (rmtreply("write"));
}
int
-rmtseek(offset, pos)
- int offset, pos;
+rmtseek(int offset, int pos) /* XXX off_t ? */
{
char line[80];
@@ -312,7 +296,7 @@ rmtseek(offset, pos)
struct mtget mts;
struct mtget *
-rmtstatus()
+rmtstatus(void)
{
int i;
char *cp;
@@ -326,8 +310,7 @@ rmtstatus()
}
int
-rmtioctl(cmd, count)
- int cmd, count;
+rmtioctl(int cmd, int count)
{
char buf[256];
@@ -338,18 +321,16 @@ rmtioctl(cmd, count)
}
static int
-rmtcall(cmd, buf)
- char *cmd, *buf;
+rmtcall(const char *cmd, const char *buf)
{
if (write(rmtape, buf, strlen(buf)) != strlen(buf))
- rmtconnaborted();
+ rmtconnaborted(0);
return (rmtreply(cmd));
}
static int
-rmtreply(cmd)
- char *cmd;
+rmtreply(const char *cmd)
{
char *cp;
char code[30], emsg[BUFSIZ];
@@ -371,26 +352,24 @@ rmtreply(cmd)
msg("Protocol to remote tape server botched (code \"%s\").\n",
code);
- rmtconnaborted();
+ rmtconnaborted(0);
}
return (atoi(code + 1));
}
int
-rmtgetb()
+rmtgetb(void)
{
char c;
if (read(rmtape, &c, 1) != 1)
- rmtconnaborted();
+ rmtconnaborted(0);
return (c);
}
/* Get a line (guaranteed to have a trailing newline). */
void
-rmtgets(line, len)
- char *line;
- int len;
+rmtgets(char *line, int len)
{
char *cp = line;
@@ -406,5 +385,5 @@ rmtgets(line, len)
*cp = '\0';
msg("Protocol to remote tape server botched.\n");
msg("(rmtgets got \"%s\").\n", line);
- rmtconnaborted();
+ rmtconnaborted(0);
}
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c
index dda11fa..b4c8f98 100644
--- a/sbin/dump/itime.c
+++ b/sbin/dump/itime.c
@@ -50,10 +50,8 @@ static const char rcsid[] =
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
-#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
-#endif
#include "dump.h"
@@ -66,13 +64,13 @@ struct dumpdates **ddatev = 0;
int nddates = 0;
int ddates_in = 0;
-static void dumprecout __P((FILE *, struct dumpdates *));
-static int getrecord __P((FILE *, struct dumpdates *));
-static int makedumpdate __P((struct dumpdates *, char *));
-static void readdumptimes __P((FILE *));
+static void dumprecout(FILE *, const struct dumpdates *);
+static int getrecord(FILE *, struct dumpdates *);
+static int makedumpdate(struct dumpdates *, const char *);
+static void readdumptimes(FILE *);
void
-initdumptimes()
+initdumptimes(void)
{
FILE *df;
@@ -104,8 +102,7 @@ initdumptimes()
}
static void
-readdumptimes(df)
- FILE *df;
+readdumptimes(FILE *df)
{
int i;
struct dumptime *dtwalk;
@@ -131,7 +128,7 @@ readdumptimes(df)
}
void
-getdumptime()
+getdumptime(void)
{
struct dumpdates *ddp;
int i;
@@ -163,7 +160,7 @@ getdumptime()
}
void
-putdumptime()
+putdumptime(void)
{
FILE *df;
struct dumpdates *dtwalk;
@@ -225,24 +222,18 @@ putdumptime()
}
static void
-dumprecout(file, what)
- FILE *file;
- struct dumpdates *what;
+dumprecout(FILE *file, const struct dumpdates *what)
{
- if (fprintf(file, DUMPOUTFMT,
- what->dd_name,
- what->dd_level,
- ctime(&what->dd_ddate)) < 0)
+ if (fprintf(file, DUMPOUTFMT, what->dd_name,
+ what->dd_level, ctime(&what->dd_ddate)) < 0)
quit("%s: %s\n", dumpdates, strerror(errno));
}
int recno;
static int
-getrecord(df, ddatep)
- FILE *df;
- struct dumpdates *ddatep;
+getrecord(FILE *df, struct dumpdates *ddatep)
{
char tbuf[BUFSIZ];
@@ -262,9 +253,7 @@ getrecord(df, ddatep)
}
static int
-makedumpdate(ddp, tbuf)
- struct dumpdates *ddp;
- char *tbuf;
+makedumpdate(struct dumpdates *ddp, const char *tbuf)
{
char un_buf[128];
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index e1fc40d..d9ea5a3 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -82,14 +82,12 @@ long dev_bsize = 1; /* recalculated below */
long blocksperfile; /* output blocks per file */
char *host = NULL; /* remote host (if any) */
-static long numarg __P((char *, long, long));
-static void obsolete __P((int *, char **[]));
-static void usage __P((void));
+static long numarg(const char *, long, long);
+static void obsolete(int *, char **[]);
+static void usage(void) __dead2;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
ino_t ino;
@@ -513,7 +511,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
fprintf(stderr,
"usage: dump [-0123456789ac"
@@ -532,9 +530,7 @@ usage()
* range (except that a vmax of 0 means unlimited).
*/
static long
-numarg(meaning, vmin, vmax)
- char *meaning;
- long vmin, vmax;
+numarg(const char *meaning, long vmin, long vmax)
{
char *p;
long val;
@@ -548,8 +544,7 @@ numarg(meaning, vmin, vmax)
}
void
-sig(signo)
- int signo;
+sig(int signo)
{
switch(signo) {
case SIGALRM:
@@ -575,8 +570,7 @@ sig(signo)
}
char *
-rawname(cp)
- char *cp;
+rawname(char *cp)
{
static char rawbuf[MAXPATHLEN];
char *dp;
@@ -596,11 +590,10 @@ rawname(cp)
if (dp == NULL)
return (NULL);
*dp = '\0';
- (void)strncpy(rawbuf, cp, MAXPATHLEN - 1);
- rawbuf[MAXPATHLEN-1] = '\0';
+ (void)strlcpy(rawbuf, cp, MAXPATHLEN - 1);
*dp = '/';
- (void)strncat(rawbuf, "/r", MAXPATHLEN - 1 - strlen(rawbuf));
- (void)strncat(rawbuf, dp + 1, MAXPATHLEN - 1 - strlen(rawbuf));
+ (void)strlcat(rawbuf, "/r", MAXPATHLEN - 1 - strlen(rawbuf));
+ (void)strlcat(rawbuf, dp + 1, MAXPATHLEN - 1 - strlen(rawbuf));
return (rawbuf);
}
@@ -610,9 +603,7 @@ rawname(cp)
* getopt(3) will like.
*/
static void
-obsolete(argcp, argvp)
- int *argcp;
- char **argvp[];
+obsolete(int *argcp, char **argvp[])
{
int argc, flags;
char *ap, **argv, *flagsp, **nargv, *p;
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index f13e7d6..78e2640 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -58,8 +58,8 @@ static const char rcsid[] =
#include "dump.h"
#include "pathnames.h"
-void alarmcatch __P((/* int, int */));
-int datesort __P((const void *, const void *));
+void alarmcatch(int);
+int datesort(const void *, const void *);
/*
* Query the operator; This previously-fascist piece of code
@@ -73,11 +73,10 @@ int datesort __P((const void *, const void *));
* that dump needs attention.
*/
static int timeout;
-static char *attnmessage; /* attention message */
+static const char *attnmessage; /* attention message */
int
-query(question)
- char *question;
+query(const char *question)
{
char replybuffer[64];
int back, errcount;
@@ -87,7 +86,7 @@ query(question)
quit("fopen on %s fails: %s\n", _PATH_TTY, strerror(errno));
attnmessage = question;
timeout = 0;
- alarmcatch();
+ alarmcatch(0);
back = -1;
errcount = 0;
do {
@@ -124,7 +123,7 @@ char lastmsg[BUFSIZ];
* sleep for 2 minutes in case nobody comes to satisfy dump
*/
void
-alarmcatch()
+alarmcatch(int sig __unused)
{
if (notify == 0) {
if (timeout == 0)
@@ -150,8 +149,7 @@ alarmcatch()
* Here if an inquisitive operator interrupts the dump program
*/
void
-interrupt(signo)
- int signo;
+interrupt(int signo __unused)
{
msg("Interrupt received.\n");
if (query("Do you want to abort dump?"))
@@ -162,8 +160,7 @@ interrupt(signo)
* We now use wall(1) to do the actual broadcasting.
*/
void
-broadcast(message)
- char *message;
+broadcast(const char *message)
{
FILE *fp;
char buf[sizeof(_PATH_WALL) + sizeof(OPGRENT) + 3];
@@ -191,7 +188,7 @@ broadcast(message)
time_t tschedule = 0;
void
-timeest()
+timeest(void)
{
double percent;
time_t tnow;
@@ -219,20 +216,13 @@ timeest()
* Schedule a printout of the estimate in the next call to timeest().
*/
void
-infosch(signal)
- int signal;
+infosch(int signal __unused)
{
tschedule = 0;
}
void
-#if __STDC__
msg(const char *fmt, ...)
-#else
-msg(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
@@ -240,11 +230,7 @@ msg(fmt, va_alist)
#ifdef TDEBUG
(void) fprintf(stderr, "pid=%d ", getpid());
#endif
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
(void) vfprintf(stderr, fmt, ap);
(void) fflush(stdout);
(void) fflush(stderr);
@@ -253,32 +239,16 @@ msg(fmt, va_alist)
}
void
-#if __STDC__
msgtail(const char *fmt, ...)
-#else
-msgtail(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
(void) vfprintf(stderr, fmt, ap);
va_end(ap);
}
void
-#if __STDC__
quit(const char *fmt, ...)
-#else
-quit(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
@@ -286,11 +256,7 @@ quit(fmt, va_alist)
#ifdef TDEBUG
(void) fprintf(stderr, "pid=%d ", getpid());
#endif
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
(void) vfprintf(stderr, fmt, ap);
va_end(ap);
(void) fflush(stdout);
@@ -304,8 +270,7 @@ quit(fmt, va_alist)
*/
struct fstab *
-allocfsent(fs)
- struct fstab *fs;
+allocfsent(const struct fstab *fs)
{
struct fstab *new;
@@ -328,7 +293,7 @@ struct pfstab {
static SLIST_HEAD(, pfstab) table;
void
-getfstab()
+getfstab(void)
{
struct fstab *fs;
struct pfstab *pf;
@@ -359,8 +324,7 @@ getfstab()
* The file name can omit the leading '/'.
*/
struct fstab *
-fstabsearch(key)
- char *key;
+fstabsearch(const char *key)
{
struct pfstab *pf;
struct fstab *fs;
@@ -390,8 +354,7 @@ fstabsearch(key)
* Tell the operator what to do
*/
void
-lastdump(arg)
- char arg; /* w ==> just what to do; W ==> most recent dumps */
+lastdump(int arg) /* w ==> just what to do; W ==> most recent dumps */
{
int i;
struct fstab *dt;
@@ -438,8 +401,7 @@ lastdump(arg)
}
int
-datesort(a1, a2)
- const void *a1, *a2;
+datesort(const void *a1, const void *a2)
{
struct dumpdates *d1 = *(struct dumpdates **)a1;
struct dumpdates *d2 = *(struct dumpdates **)a2;
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c
index 8097565..5145717 100644
--- a/sbin/dump/tape.c
+++ b/sbin/dump/tape.c
@@ -55,13 +55,9 @@ static const char rcsid[] =
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
-#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#else
-int write(), read();
-#endif
#include "dump.h"
@@ -75,12 +71,12 @@ extern int cartridge;
extern char *host;
char *nexttape;
-static int atomic __P((ssize_t (*)(), int, char *, int));
-static void doslave __P((int, int));
-static void enslave __P((void));
-static void flushtape __P((void));
-static void killall __P((void));
-static void rollforward __P((void));
+static int atomic(ssize_t (*)(), int, char *, int);
+static void doslave(int, int);
+static void enslave(void);
+static void flushtape(void);
+static void killall(void);
+static void rollforward(void);
/*
* Concurrent dump mods (Caltech) - disk block reading and tape writing
@@ -122,7 +118,7 @@ static jmp_buf jmpbuf; /* where to jump to if we are ready when the */
/* SIGUSR2 arrives from the previous slave */
int
-alloctape()
+alloctape(void)
{
int pgoff = getpagesize() - 1;
char *buf;
@@ -162,18 +158,13 @@ alloctape()
}
void
-writerec(dp, isspcl)
- char *dp;
- int isspcl;
+writerec(char *dp, int isspcl)
{
slp->req[trecno].dblk = (daddr_t)0;
slp->req[trecno].count = 1;
-#ifndef __alpha__
- *(union u_spcl *)(*(nextblock)++) = *(union u_spcl *)dp;
-#else
+ /* Can't do a structure assignment due to alignment problems */
bcopy(dp, *(nextblock)++, sizeof (union u_spcl));
-#endif
if (isspcl)
lastspclrec = spcl.c_tapea;
trecno++;
@@ -183,9 +174,7 @@ writerec(dp, isspcl)
}
void
-dumpblock(blkno, size)
- daddr_t blkno;
- int size;
+dumpblock(daddr_t blkno, int size)
{
int avail, tpblks, dblkno;
@@ -206,8 +195,7 @@ dumpblock(blkno, size)
int nogripe = 0;
void
-tperror(signo)
- int signo;
+tperror(int signo __unused)
{
if (pipeout) {
@@ -228,15 +216,14 @@ tperror(signo)
}
void
-sigpipe(signo)
- int signo;
+sigpipe(int signo __unused)
{
quit("Broken pipe\n");
}
static void
-flushtape()
+flushtape(void)
{
int i, blks, got;
long lastfirstrec;
@@ -313,7 +300,7 @@ flushtape()
}
void
-trewind()
+trewind(void)
{
struct stat sb;
int f;
@@ -394,7 +381,7 @@ close_rewind()
}
void
-rollforward()
+rollforward(void)
{
struct req *p, *q, *prev;
struct slave *tslp;
@@ -509,8 +496,7 @@ rollforward()
* everything continues as if nothing had happened.
*/
void
-startnewtape(top)
- int top;
+startnewtape(int top)
{
int parentpid;
int childpid;
@@ -642,8 +628,7 @@ restore_check_point:
}
void
-dumpabort(signo)
- int signo;
+dumpabort(int signo __unused)
{
if (master != 0 && master != getpid())
@@ -674,8 +659,7 @@ Exit(status)
* proceed - handler for SIGUSR2, used to synchronize IO between the slaves.
*/
void
-proceed(signo)
- int signo;
+proceed(int signo __unused)
{
if (ready)
@@ -684,7 +668,7 @@ proceed(signo)
}
void
-enslave()
+enslave(void)
{
int cmd[2];
int i, j;
@@ -728,7 +712,7 @@ enslave()
}
void
-killall()
+killall(void)
{
int i;
@@ -747,9 +731,7 @@ killall()
* get the lock back for the next cycle by swapping descriptors.
*/
static void
-doslave(cmd, slave_number)
- int cmd;
- int slave_number;
+doslave(int cmd, int slave_number)
{
int nread;
int nextslave, size, wrote, eot_count;
@@ -863,11 +845,7 @@ doslave(cmd, slave_number)
* loop until the count is satisfied (or error).
*/
static int
-atomic(func, fd, buf, count)
- ssize_t (*func)();
- int fd;
- char *buf;
- int count;
+atomic(ssize_t (*func)(), int fd, char *buf, int count)
{
int got, need = count;
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index f948dd2..ef57f26 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -50,11 +50,9 @@ static const char rcsid[] =
#include <ctype.h>
#include <stdio.h>
-#ifdef __STDC__
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#endif
#include "dump.h"
@@ -67,11 +65,11 @@ typedef quad_t fsizeT;
typedef long fsizeT;
#endif
-static int dirindir __P((ino_t ino, daddr_t blkno, int level, long *size,
- long *tapesize, int nodump));
-static void dmpindir __P((ino_t ino, daddr_t blk, int level, fsizeT *size));
-static int searchdir __P((ino_t ino, daddr_t blkno, long size, long filesize,
- long *tapesize, int nodump));
+static int dirindir(ino_t ino, daddr_t blkno, int level, long *size,
+ long *tapesize, int nodump);
+static void dmpindir(ino_t ino, daddr_t blk, int level, fsizeT *size);
+static int searchdir(ino_t ino, daddr_t blkno, long size, long filesize,
+ long *tapesize, int nodump);
/*
* This is an estimation of the number of TP_BSIZE blocks in the file.
@@ -81,8 +79,7 @@ static int searchdir __P((ino_t ino, daddr_t blkno, long size, long filesize,
* hence the estimate may be high.
*/
long
-blockest(dp)
- struct dinode *dp;
+blockest(struct dinode *dp)
{
long blkest, sizeest;
@@ -134,9 +131,7 @@ blockest(dp)
* the directories in the filesystem.
*/
int
-mapfiles(maxino, tapesize)
- ino_t maxino;
- long *tapesize;
+mapfiles(ino_t maxino, long *tapesize)
{
int mode;
ino_t ino;
@@ -191,9 +186,7 @@ mapfiles(maxino, tapesize)
* pass using this algorithm.
*/
int
-mapdirs(maxino, tapesize)
- ino_t maxino;
- long *tapesize;
+mapdirs(ino_t maxino, long *tapesize)
{
struct dinode *dp;
int i, isdir, nodump;
@@ -263,13 +256,8 @@ mapdirs(maxino, tapesize)
* require the directory to be dumped.
*/
static int
-dirindir(ino, blkno, ind_level, filesize, tapesize, nodump)
- ino_t ino;
- daddr_t blkno;
- int ind_level;
- long *filesize;
- long *tapesize;
- int nodump;
+dirindir(ino_t ino, daddr_t blkno, int ind_level, long *filesize,
+ long *tapesize, int nodump)
{
int ret = 0;
int i;
@@ -305,13 +293,8 @@ dirindir(ino, blkno, ind_level, filesize, tapesize, nodump)
* contains any subdirectories.
*/
static int
-searchdir(ino, blkno, size, filesize, tapesize, nodump)
- ino_t ino;
- daddr_t blkno;
- long size;
- long filesize;
- long *tapesize;
- int nodump;
+searchdir(ino_t ino, daddr_t blkno, long size, long filesize,
+ long *tapesize, int nodump)
{
struct direct *dp;
struct dinode *ip;
@@ -373,9 +356,7 @@ searchdir(ino, blkno, size, filesize, tapesize, nodump)
* Dump the contents of an inode to tape.
*/
void
-dumpino(dp, ino)
- struct dinode *dp;
- ino_t ino;
+dumpino(struct dinode *dp, ino_t ino)
{
int ind_level, cnt;
fsizeT size;
@@ -450,11 +431,7 @@ dumpino(dp, ino)
* Read indirect blocks, and pass the data blocks to be dumped.
*/
static void
-dmpindir(ino, blk, ind_level, size)
- ino_t ino;
- daddr_t blk;
- int ind_level;
- fsizeT *size;
+dmpindir(ino_t ino, daddr_t blk, int ind_level, fsizeT *size)
{
int i, cnt;
daddr_t idblk[MAXNINDIR];
@@ -484,10 +461,7 @@ dmpindir(ino, blk, ind_level, size)
* Collect up the data into tape record sized buffers and output them.
*/
void
-blksout(blkp, frags, ino)
- daddr_t *blkp;
- int frags;
- ino_t ino;
+blksout(daddr_t *blkp, int frags, ino_t ino)
{
daddr_t *bp;
int i, j, count, blks, tbperdb;
@@ -522,10 +496,7 @@ blksout(blkp, frags, ino)
* Dump a map to the tape.
*/
void
-dumpmap(map, type, ino)
- char *map;
- int type;
- ino_t ino;
+dumpmap(char *map, int type, ino_t ino)
{
int i;
char *cp;
@@ -541,8 +512,7 @@ dumpmap(map, type, ino)
* Write a header record to the dump tape.
*/
void
-writeheader(ino)
- ino_t ino;
+writeheader(ino_t ino)
{
int32_t sum, cnt, *lp;
@@ -563,8 +533,7 @@ writeheader(ino)
}
struct dinode *
-getino(inum)
- ino_t inum;
+getino(ino_t inum)
{
static daddr_t minino, maxino;
static struct dinode inoblock[MAXINOPB];
@@ -589,10 +558,7 @@ int breaderrors = 0;
#define BREADEMAX 32
void
-bread(blkno, buf, size)
- daddr_t blkno;
- char *buf;
- int size;
+bread(daddr_t blkno, char *buf, int size)
{
int cnt, i;
diff --git a/sbin/dump/unctime.c b/sbin/dump/unctime.c
index 7184e3b..f61f2f3 100644
--- a/sbin/dump/unctime.c
+++ b/sbin/dump/unctime.c
@@ -47,11 +47,8 @@ static const char rcsid[] =
*
* Return -1 if the string is not in ctime format.
*/
-
-
time_t
-unctime(str)
- char *str;
+unctime(char *str)
{
struct tm then;
OpenPOWER on IntegriCloud