Uncomment-out part of FreeBSD code so that we can calculate partition

index from a filename.
This commit is contained in:
toshii 2001-09-17 16:26:56 +00:00
parent e6b9c3dd70
commit 04f91a6594

View File

@ -1,4 +1,4 @@
/* $NetBSD: newfs_msdos.c,v 1.8 2001/09/10 19:25:35 pooka Exp $ */ /* $NetBSD: newfs_msdos.c,v 1.9 2001/09/17 16:26:56 toshii Exp $ */
/* /*
* Copyright (c) 1998 Robert Nordier * Copyright (c) 1998 Robert Nordier
@ -33,7 +33,7 @@
static const char rcsid[] = static const char rcsid[] =
"$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $"; "$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
#else #else
__RCSID("$NetBSD: newfs_msdos.c,v 1.8 2001/09/10 19:25:35 pooka Exp $"); __RCSID("$NetBSD: newfs_msdos.c,v 1.9 2001/09/17 16:26:56 toshii Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -733,7 +733,6 @@ getdiskinfo(int fd, const char *fname, const char *dtype, int oflag,
int slice, part, fd1, i, e; int slice, part, fd1, i, e;
int maxpartitions; int maxpartitions;
#ifdef __FreeBSD__
slice = part = -1; slice = part = -1;
s1 = fname; s1 = fname;
if ((s2 = strrchr(s1, '/'))) if ((s2 = strrchr(s1, '/')))
@ -744,6 +743,7 @@ getdiskinfo(int fd, const char *fname, const char *dtype, int oflag,
else else
while (isdigit(*++s2)); while (isdigit(*++s2));
s1 = s2; s1 = s2;
#ifdef __FreeBSD__
if (s2 && *s2 == 's') { if (s2 && *s2 == 's') {
slice = strtol(s2 + 1, &s, 10); slice = strtol(s2 + 1, &s, 10);
if (slice < 1 || slice > MAX_SLICES - BASE_SLICE) if (slice < 1 || slice > MAX_SLICES - BASE_SLICE)
@ -753,8 +753,6 @@ getdiskinfo(int fd, const char *fname, const char *dtype, int oflag,
s2 = s; s2 = s;
} }
} }
#else
slice = -1;
#endif #endif
#ifdef __NetBSD__ #ifdef __NetBSD__