| @@ -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 */ |
244 | struct format { | | 244 | static 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}, |