Subject: bin/13961: bin/df with corrected style
To: None <gnats-bugs@gnats.netbsd.org>
From: Petri Koistinen <thoron@mb-u07ip065.mbnet.fi>
List: netbsd-bugs
Date: 09/16/2001 01:53:17
>Number: 13961
>Category: bin
>Synopsis: bin/df with corrected style
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Sep 15 15:53:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Petri Koistinen
>Release: NetBSD-current Sun Sep 16 2001
>Organization:
>Environment:
System: NetBSD mb-u07ip065.mbnet.fi 1.5X NetBSD 1.5X (DING-DONG) #1: Sun Sep 16 03:33:42 EEST 2001 thoron@legoland:/usr/src/sys/arch/amiga/compile/DING-DONG amiga
Architecture: m68k
Machine: amiga
>Description:
Please apply attached patch for bin/df.
>How-To-Repeat:
>Fix:
Index: df.c
===================================================================
RCS file: /cvsroot/basesrc/bin/df/df.c,v
retrieving revision 1.40
diff -u -r1.40 df.c
--- df.c 2001/02/20 23:02:07 1.40
+++ df.c 2001/09/15 22:43:37
@@ -1,4 +1,4 @@
-/* $NetBSD: df.c,v 1.40 2001/02/20 23:02:07 cgd Exp $ */
+/* $NetBSD: df.c,v 1.40 2001/02/20 23:02:07 cgd Exp $ */
/*
* Copyright (c) 1980, 1990, 1993, 1994
@@ -67,26 +67,24 @@
#include <string.h>
#include <unistd.h>
-extern char * strpct __P((u_long num, u_long denom, u_int digits));
+extern char *strpct(u_long num, u_long denom, u_int digits);
-int main __P((int, char *[]));
-int bread __P((off_t, void *, int));
-char *getmntpt __P((char *));
-void prtstat __P((struct statfs *, int));
-int ufs_df __P((char *, struct statfs *));
-int selected __P((const char *));
-void maketypelist __P((char *));
-long regetmntinfo __P((struct statfs **, long));
-void usage __P((void));
+int main(int, char *[]);
+int bread(off_t, void *, int);
+char *getmntpt(char *);
+void prtstat(struct statfs *, int);
+int ufs_df(char *, struct statfs *);
+int selected(const char *);
+void maketypelist(char *);
+long regetmntinfo(struct statfs **, long);
+void usage(void);
int aflag, iflag, kflag, lflag, mflag, nflag, Pflag;
char **typelist = NULL;
struct ufs_args mdev;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat stbuf;
struct statfs *mntbuf;
@@ -94,6 +92,7 @@
int ch, i, maxwidth, width;
char *mntpt;
+ setprogname(argv[0]);
while ((ch = getopt(argc, argv, "aiklmnPt:")) != -1)
switch (ch) {
case 'a':
@@ -211,10 +210,9 @@
}
char *
-getmntpt(name)
- char *name;
+getmntpt(char *name)
{
- long mntsize, i;
+ long i, mntsize;
struct statfs *mntbuf;
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
@@ -228,8 +226,7 @@
static enum { IN_LIST, NOT_IN_LIST } which;
int
-selected(type)
- const char *type;
+selected(const char *type)
{
char **av;
@@ -243,8 +240,7 @@
}
void
-maketypelist(fslist)
- char *fslist;
+maketypelist(char *fslist)
{
int i;
char *nextcp, **av;
@@ -287,9 +283,7 @@
* current (not cached) info. Returns the new count of valid statfs bufs.
*/
long
-regetmntinfo(mntbufp, mntsize)
- struct statfs **mntbufp;
- long mntsize;
+regetmntinfo(struct statfs **mntbufp, long mntsize)
{
int i, j;
struct statfs *mntbuf;
@@ -336,15 +330,13 @@
* Print out status about a filesystem.
*/
void
-prtstat(sfsp, maxwidth)
- struct statfs *sfsp;
- int maxwidth;
+prtstat(struct statfs *sfsp, int maxwidth)
{
static long blocksize;
static int headerlen, timesthrough;
static char *header;
long used, availblks, inodes;
- static char *full = "100%";
+ static char *full = "100%";
if (maxwidth < 11)
maxwidth = 11;
@@ -400,12 +392,10 @@
} sb;
#define sblock sb.iu_fs
-int rfd;
+int rfd;
int
-ufs_df(file, sfsp)
- char *file;
- struct statfs *sfsp;
+ufs_df(char *file, struct statfs *sfsp)
{
char *mntpt;
static int synced;
@@ -446,10 +436,7 @@
}
int
-bread(off, buf, cnt)
- off_t off;
- void *buf;
- int cnt;
+bread(off_t off, void *buf, int cnt)
{
int nr;
@@ -465,7 +452,7 @@
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"Usage: %s [-aiklmnP] [-t type] [file | file_system ...]\n",
>Release-Note:
>Audit-Trail:
>Unformatted: