Module Name: src Committed By: christos Date: Wed Feb 13 00:40:29 UTC 2013
Modified Files: src/sbin/fdisk: fdisk.c Log Message: Don't produce spurious errors when creating labels on files. To generate a diff of this commit: cvs rdiff -u -r1.143 -r1.144 src/sbin/fdisk/fdisk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/fdisk/fdisk.c diff -u src/sbin/fdisk/fdisk.c:1.143 src/sbin/fdisk/fdisk.c:1.144 --- src/sbin/fdisk/fdisk.c:1.143 Fri Feb 8 20:50:04 2013 +++ src/sbin/fdisk/fdisk.c Tue Feb 12 19:40:28 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: fdisk.c,v 1.143 2013/02/09 01:50:04 christos Exp $ */ +/* $NetBSD: fdisk.c,v 1.144 2013/02/13 00:40:28 christos Exp $ */ /* * Mach Operating System @@ -39,7 +39,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: fdisk.c,v 1.143 2013/02/09 01:50:04 christos Exp $"); +__RCSID("$NetBSD: fdisk.c,v 1.144 2013/02/13 00:40:28 christos Exp $"); #endif /* not lint */ #define MBRPTYPENAMES @@ -1645,6 +1645,8 @@ intuit_translated_geometry(void) } if (xheads == -1) { + if (F_flag) + return; warnx("Cannot determine the number of heads"); return; } @@ -2671,6 +2673,8 @@ read_s0(daddr_t offset, struct mbr_secto return -1; } if (boot->mbr_magic != LE_MBR_MAGIC) { + if (F_flag && boot->mbr_magic == 0) + return -1; warnx("%s partition table invalid, " "no magic in sector %"PRIdaddr, tabletype, offset); return -1;