Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/fdisk Don't produce spurious errors when creating label...



details:   https://anonhg.NetBSD.org/src/rev/cfad2c69b6dd
branches:  trunk
changeset: 784883:cfad2c69b6dd
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 13 00:40:28 2013 +0000

description:
Don't produce spurious errors when creating labels on files.

diffstat:

 sbin/fdisk/fdisk.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 0ea8dad35237 -r cfad2c69b6dd sbin/fdisk/fdisk.c
--- a/sbin/fdisk/fdisk.c        Tue Feb 12 23:02:58 2013 +0000
+++ b/sbin/fdisk/fdisk.c        Wed Feb 13 00:40:28 2013 +0000
@@ -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 @@
        }
 
        if (xheads == -1) {
+               if (F_flag)
+                       return;
                warnx("Cannot determine the number of heads");
                return;
        }
@@ -2671,6 +2673,8 @@
                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;



Home | Main Index | Thread Index | Old Index