Sat Aug 27 18:37:41 2011 UTC ()
static + __dead


(joerg)
diff -r1.39 -r1.40 src/sbin/mknod/mknod.c
diff -r1.10 -r1.11 src/sbin/mknod/pack_dev.c

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

--- src/sbin/mknod/mknod.c 2009/02/13 01:37:23 1.39
+++ src/sbin/mknod/mknod.c 2011/08/27 18:37:41 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mknod.c,v 1.39 2009/02/13 01:37:23 lukem Exp $ */ 1/* $NetBSD: mknod.c,v 1.40 2011/08/27 18:37:41 joerg Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 2001 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 Charles M. Hannum. 8 * by Charles M. Hannum.
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.
@@ -27,54 +27,53 @@ @@ -27,54 +27,53 @@
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#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#ifndef lint 37#ifndef lint
38__COPYRIGHT("@(#) Copyright (c) 1998\ 38__COPYRIGHT("@(#) Copyright (c) 1998\
39 The NetBSD Foundation, Inc. All rights reserved."); 39 The NetBSD Foundation, Inc. All rights reserved.");
40__RCSID("$NetBSD: mknod.c,v 1.39 2009/02/13 01:37:23 lukem Exp $"); 40__RCSID("$NetBSD: mknod.c,v 1.40 2011/08/27 18:37:41 joerg Exp $");
41#endif /* not lint */ 41#endif /* not lint */
42 42
43#include <sys/types.h> 43#include <sys/types.h>
44#include <sys/stat.h> 44#include <sys/stat.h>
45#include <sys/param.h> 45#include <sys/param.h>
46#if !HAVE_NBTOOL_CONFIG_H 46#if !HAVE_NBTOOL_CONFIG_H
47#include <sys/sysctl.h> 47#include <sys/sysctl.h>
48#endif 48#endif
49 49
50#include <err.h> 50#include <err.h>
51#include <errno.h> 51#include <errno.h>
52#include <limits.h> 52#include <limits.h>
53#include <stdio.h> 53#include <stdio.h>
54#include <stdlib.h> 54#include <stdlib.h>
55#include <unistd.h> 55#include <unistd.h>
56#include <pwd.h> 56#include <pwd.h>
57#include <grp.h> 57#include <grp.h>
58#include <string.h> 58#include <string.h>
59#include <ctype.h> 59#include <ctype.h>
60 60
61#include "pack_dev.h" 61#include "pack_dev.h"
62 62
63static int gid_name(const char *, gid_t *); 63static int gid_name(const char *, gid_t *);
64static portdev_t callPack(pack_t *, int, u_long *); 64static portdev_t callPack(pack_t *, int, u_long *);
65 65
66 int main(int, char *[]); 66__dead static void usage(void);
67static void usage(void); 
68 67
69#ifdef KERN_DRIVERS 68#ifdef KERN_DRIVERS
70static struct kinfo_drivers *kern_drivers; 69static struct kinfo_drivers *kern_drivers;
71static int num_drivers; 70static int num_drivers;
72 71
73static void get_device_info(void); 72static void get_device_info(void);
74static void print_device_info(char **); 73static void print_device_info(char **);
75static int major_from_name(const char *, mode_t); 74static int major_from_name(const char *, mode_t);
76#endif 75#endif
77 76
78#define MAXARGS 3 /* 3 for bsdos, 2 for rest */ 77#define MAXARGS 3 /* 3 for bsdos, 2 for rest */
79 78
80int 79int

cvs diff -r1.10 -r1.11 src/sbin/mknod/pack_dev.c (expand / switch to unified diff)

--- src/sbin/mknod/pack_dev.c 2009/02/13 01:37:23 1.10
+++ src/sbin/mknod/pack_dev.c 2011/08/27 18:37:41 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pack_dev.c,v 1.10 2009/02/13 01:37:23 lukem Exp $ */ 1/* $NetBSD: pack_dev.c,v 1.11 2011/08/27 18:37:41 joerg Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 2001 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 Charles M. Hannum. 8 * by Charles M. Hannum.
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.
@@ -25,27 +25,27 @@ @@ -25,27 +25,27 @@
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#if HAVE_NBTOOL_CONFIG_H 32#if HAVE_NBTOOL_CONFIG_H
33#include "nbtool_config.h" 33#include "nbtool_config.h"
34#endif 34#endif
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37#if !defined(lint) 37#if !defined(lint)
38__RCSID("$NetBSD: pack_dev.c,v 1.10 2009/02/13 01:37:23 lukem Exp $"); 38__RCSID("$NetBSD: pack_dev.c,v 1.11 2011/08/27 18:37:41 joerg Exp $");
39#endif /* not lint */ 39#endif /* not lint */
40 40
41#include <sys/types.h> 41#include <sys/types.h>
42#include <sys/stat.h> 42#include <sys/stat.h>
43 43
44#include <limits.h> 44#include <limits.h>
45#include <stdio.h> 45#include <stdio.h>
46#include <stdlib.h> 46#include <stdlib.h>
47#include <string.h> 47#include <string.h>
48#include <unistd.h> 48#include <unistd.h>
49 49
50#include "pack_dev.h" 50#include "pack_dev.h"
51 51
@@ -231,27 +231,27 @@ pack_bsdos(int n, u_long numbers[], cons @@ -231,27 +231,27 @@ pack_bsdos(int n, u_long numbers[], cons
231 *error = iMajorError; 231 *error = iMajorError;
232 if ((u_long)unit_12_12_8(dev) != numbers[1]) 232 if ((u_long)unit_12_12_8(dev) != numbers[1])
233 *error = "invalid unit number"; 233 *error = "invalid unit number";
234 if ((u_long)subunit_12_12_8(dev) != numbers[2]) 234 if ((u_long)subunit_12_12_8(dev) != numbers[2])
235 *error = "invalid subunit number"; 235 *error = "invalid subunit number";
236 } else 236 } else
237 *error = tooManyFields; 237 *error = tooManyFields;
238 return (dev); 238 return (dev);
239} 239}
240 240
241 241
242 /* list of formats and pack functions */ 242 /* list of formats and pack functions */
243 /* this list must be sorted lexically */ 243 /* this list must be sorted lexically */
244struct format { 244static struct format {
245 const char *name; 245 const char *name;
246 pack_t *pack; 246 pack_t *pack;
247} formats[] = { 247} formats[] = {
248 {"386bsd", pack_8_8}, 248 {"386bsd", pack_8_8},
249 {"4bsd", pack_8_8}, 249 {"4bsd", pack_8_8},
250 {"bsdos", pack_bsdos}, 250 {"bsdos", pack_bsdos},
251 {"freebsd", pack_freebsd}, 251 {"freebsd", pack_freebsd},
252 {"hpux", pack_8_24}, 252 {"hpux", pack_8_24},
253 {"isc", pack_8_8}, 253 {"isc", pack_8_8},
254 {"linux", pack_8_8}, 254 {"linux", pack_8_8},
255 {"native", pack_native}, 255 {"native", pack_native},
256 {"netbsd", pack_netbsd}, 256 {"netbsd", pack_netbsd},
257 {"osf1", pack_12_20}, 257 {"osf1", pack_12_20},