diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-11-14 00:13:48 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-11-14 00:13:48 +0000 |
commit | b1feb3d28ceb2ef06ad7ab1191c9aef43bd612f7 (patch) | |
tree | d9f53fe70e911ad1c46b00680269ab52fe9a42d8 | |
parent | b3f353eabb55b1c283850062060b193863a47a46 (diff) |
If none of -i, -u or -e are specified exit immediately after the
MBR or GPT is printed. Do not attempt to read the MBR template file,
construct an initial mbr, etc.
-rw-r--r-- | sbin/fdisk/fdisk.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 21ace844aa3..1521eee9a38 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdisk.c,v 1.84 2015/11/13 22:27:35 krw Exp $ */ +/* $OpenBSD: fdisk.c,v 1.85 2015/11/14 00:13:47 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -180,9 +180,10 @@ main(int argc, char *argv[]) errx(1, "Can't get disk geometry, please use [-chs] " "to specify."); - /* Print out current MBRs on disk */ - if ((i_flag + u_flag + e_flag) == 0) + if ((i_flag + u_flag + e_flag) == 0) { USER_print_disk(); + goto done; + } /* Create initial/default MBR. */ if (i_flag == 0) { @@ -237,6 +238,7 @@ main(int argc, char *argv[]) if (e_flag) USER_edit(0, 0); +done: close(disk.fd); return (0); |