Thu Jun 9 21:23:30 2011 UTC ()
fix compilation.


(christos)
diff -r1.16 -r1.17 src/sbin/fsck/fsutil.h
diff -r1.22 -r1.23 src/sbin/fsck_msdos/main.c
diff -r1.40 -r1.41 src/sbin/fsdb/fsdb.c

cvs diff -r1.16 -r1.17 src/sbin/fsck/fsutil.h (expand / switch to unified diff)

--- src/sbin/fsck/fsutil.h 2011/06/09 19:57:50 1.16
+++ src/sbin/fsck/fsutil.h 2011/06/09 21:23:29 1.17
@@ -1,40 +1,41 @@ @@ -1,40 +1,41 @@
1/* $NetBSD: fsutil.h,v 1.16 2011/06/09 19:57:50 christos Exp $ */ 1/* $NetBSD: fsutil.h,v 1.17 2011/06/09 21:23:29 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christos Zoulas. All rights reserved. 4 * Copyright (c) 1996 Christos Zoulas. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#include <stdarg.h> 27#include <stdarg.h>
 28#include <signal.h>
28 29
29void errexit(const char *, ...) 30void errexit(const char *, ...)
30 __attribute__((__noreturn__,__format__(__printf__,1,2)));  31 __attribute__((__noreturn__,__format__(__printf__,1,2)));
31void pfatal(const char *, ...) 32void pfatal(const char *, ...)
32 __attribute__((__format__(__printf__,1,2)));  33 __attribute__((__format__(__printf__,1,2)));
33void pwarn(const char *, ...) 34void pwarn(const char *, ...)
34 __attribute__((__format__(__printf__,1,2)));  35 __attribute__((__format__(__printf__,1,2)));
35void perr(const char *, ...) 36void perr(const char *, ...)
36 __attribute__((__format__(__printf__,1,2)));  37 __attribute__((__format__(__printf__,1,2)));
37void panic(const char *, ...) 38void panic(const char *, ...)
38 __attribute__((__noreturn__,__format__(__printf__,1,2)));  39 __attribute__((__noreturn__,__format__(__printf__,1,2)));
39void vmsg(int, const char *, va_list) 40void vmsg(int, const char *, va_list)
40 __attribute__((__format__(__printf__,2,0))); 41 __attribute__((__format__(__printf__,2,0)));

cvs diff -r1.22 -r1.23 src/sbin/fsck_msdos/main.c (expand / switch to unified diff)

--- src/sbin/fsck_msdos/main.c 2010/04/11 08:23:52 1.22
+++ src/sbin/fsck_msdos/main.c 2011/06/09 21:23:29 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: main.c,v 1.22 2010/04/11 08:23:52 hannken Exp $ */ 1/* $NetBSD: main.c,v 1.23 2011/06/09 21:23:29 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995 Wolfgang Solfrank 4 * Copyright (C) 1995 Wolfgang Solfrank
5 * Copyright (c) 1995 Martin Husemann 5 * Copyright (c) 1995 Martin Husemann
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -18,27 +18,27 @@ @@ -18,27 +18,27 @@
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30#ifndef lint 30#ifndef lint
31__RCSID("$NetBSD: main.c,v 1.22 2010/04/11 08:23:52 hannken Exp $"); 31__RCSID("$NetBSD: main.c,v 1.23 2011/06/09 21:23:29 christos Exp $");
32#endif /* not lint */ 32#endif /* not lint */
33 33
34#include <stdlib.h> 34#include <stdlib.h>
35#include <string.h> 35#include <string.h>
36#include <stdio.h> 36#include <stdio.h>
37#include <unistd.h> 37#include <unistd.h>
38#include <err.h> 38#include <err.h>
39#include <errno.h> 39#include <errno.h>
40#include <stdarg.h> 40#include <stdarg.h>
41#include <signal.h> 41#include <signal.h>
42 42
43#include "fsutil.h" 43#include "fsutil.h"
44#include "snapshot.h" 44#include "snapshot.h"
@@ -51,32 +51,26 @@ int preen; /* set when preening */ @@ -51,32 +51,26 @@ int preen; /* set when preening */
51int rdonly; /* device is opened read only (supersedes above) */ 51int rdonly; /* device is opened read only (supersedes above) */
52 52
53static void usage(void) __dead; 53static void usage(void) __dead;
54 54
55static void 55static void
56usage(void) 56usage(void)
57{ 57{
58 (void)fprintf(stderr, 58 (void)fprintf(stderr,
59 "Usage: %s [-fnpy] [-x snap_backup] filesystem ... \n", 59 "Usage: %s [-fnpy] [-x snap_backup] filesystem ... \n",
60 getprogname()); 60 getprogname());
61 exit(FSCK_EXIT_USAGE); 61 exit(FSCK_EXIT_USAGE);
62} 62}
63 63
64static void 
65catch(int n) 
66{ 
67 exit(FSCK_EXIT_SIGNALLED); 
68} 
69 
70int 64int
71main(int argc, char **argv) 65main(int argc, char **argv)
72{ 66{
73 int ret = FSCK_EXIT_OK, erg; 67 int ret = FSCK_EXIT_OK, erg;
74 int ch, snapfd; 68 int ch, snapfd;
75 char *snap_backup = NULL, *snap_dev; 69 char *snap_backup = NULL, *snap_dev;
76 70
77 while ((ch = getopt(argc, argv, "pPqynfx:")) != -1) { 71 while ((ch = getopt(argc, argv, "pPqynfx:")) != -1) {
78 switch (ch) { 72 switch (ch) {
79 case 'f': 73 case 'f':
80 /* 74 /*
81 * We are always forced, since we don't 75 * We are always forced, since we don't
82 * have a clean flag 76 * have a clean flag

cvs diff -r1.40 -r1.41 src/sbin/fsdb/fsdb.c (expand / switch to unified diff)

--- src/sbin/fsdb/fsdb.c 2011/06/09 19:57:53 1.40
+++ src/sbin/fsdb/fsdb.c 2011/06/09 21:23:30 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fsdb.c,v 1.40 2011/06/09 19:57:53 christos Exp $ */ 1/* $NetBSD: fsdb.c,v 1.41 2011/06/09 21:23:30 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by John T. Kohl. 8 * by John T. Kohl.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#ifndef lint 33#ifndef lint
34__RCSID("$NetBSD: fsdb.c,v 1.40 2011/06/09 19:57:53 christos Exp $"); 34__RCSID("$NetBSD: fsdb.c,v 1.41 2011/06/09 21:23:30 christos Exp $");
35#endif /* not lint */ 35#endif /* not lint */
36 36
37#include <sys/types.h> 37#include <sys/types.h>
38#include <sys/stat.h> 38#include <sys/stat.h>
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/time.h> 40#include <sys/time.h>
41#include <sys/mount.h> 41#include <sys/mount.h>
42#include <ctype.h> 42#include <ctype.h>
43#include <fcntl.h> 43#include <fcntl.h>
44#include <grp.h> 44#include <grp.h>
45#include <histedit.h> 45#include <histedit.h>
46#include <limits.h> 46#include <limits.h>
47#include <pwd.h> 47#include <pwd.h>
@@ -129,27 +129,27 @@ main(int argc, char *argv[]) @@ -129,27 +129,27 @@ main(int argc, char *argv[])
129 if (fsys == NULL) 129 if (fsys == NULL)
130 usage(); 130 usage();
131 endian = 0; 131 endian = 0;
132 if (setup(fsys, fsys) <= 0) 132 if (setup(fsys, fsys) <= 0)
133 errx(1, "cannot set up file system `%s'", fsys); 133 errx(1, "cannot set up file system `%s'", fsys);
134 printf("Editing file system `%s'\nLast Mounted on %s\n", fsys, 134 printf("Editing file system `%s'\nLast Mounted on %s\n", fsys,
135 sblock->fs_fsmnt); 135 sblock->fs_fsmnt);
136 rval = cmdloop(); 136 rval = cmdloop();
137 if (nflag) 137 if (nflag)
138 exit(rval); 138 exit(rval);
139 sblock->fs_clean = 0; /* mark it dirty */ 139 sblock->fs_clean = 0; /* mark it dirty */
140 sbdirty(); 140 sbdirty();
141 markclean = 0; 141 markclean = 0;
142 ckfini(); 142 ckfini(1);
143 printf("*** FILE SYSTEM MARKED DIRTY\n"); 143 printf("*** FILE SYSTEM MARKED DIRTY\n");
144 printf("*** BE SURE TO RUN FSCK TO CLEAN UP ANY DAMAGE\n"); 144 printf("*** BE SURE TO RUN FSCK TO CLEAN UP ANY DAMAGE\n");
145 printf("*** IF IT WAS MOUNTED, RE-MOUNT WITH -u -o reload\n"); 145 printf("*** IF IT WAS MOUNTED, RE-MOUNT WITH -u -o reload\n");
146 exit(rval); 146 exit(rval);
147} 147}
148 148
149#define CMDFUNC(func) static int func (int argc, char *argv[]) 149#define CMDFUNC(func) static int func (int argc, char *argv[])
150#define CMDFUNCSTART(func) static int func(argc, argv) \ 150#define CMDFUNCSTART(func) static int func(argc, argv) \
151 int argc; \ 151 int argc; \
152 char *argv[]; 152 char *argv[];
153 153
154CMDFUNC(helpfn); 154CMDFUNC(helpfn);
155CMDFUNC(focus); /* focus on inode */ 155CMDFUNC(focus); /* focus on inode */