summaryrefslogtreecommitdiff
path: root/sbin/disklabel/disklabel.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2008-04-06 13:10:44 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2008-04-06 13:10:44 +0000
commitaf99c54746da90cb1b5325999189814f825c0a55 (patch)
tree5caf97fbc4ccba47c4bda0b9c63c68f83dc46f6e /sbin/disklabel/disklabel.c
parentd723936a78e4d321a5a340a949fa29e4b86f8226 (diff)
Fix logic botch I introduced with r1.123 which effectively disabled
the '-c' and '-d` commands. With the removal of 'rflag' (logically making it always false), (a || (rflag && cflag + dflag) || b) should be (a || b), not (a || (cflag + dflag) || b). This fixes 'disklabel -w -d <disk>' as used in the install scripts. Reported by Peter Kun on misc@. Thanks!
Diffstat (limited to 'sbin/disklabel/disklabel.c')
-rw-r--r--sbin/disklabel/disklabel.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 376fc05a6f5..63903991cd5 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.123 2008/03/23 19:42:17 krw Exp $ */
+/* $OpenBSD: disklabel.c,v 1.124 2008/04/06 13:10:43 krw Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -39,7 +39,7 @@ static const char copyright[] =
#endif /* not lint */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.123 2008/03/23 19:42:17 krw Exp $";
+static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.124 2008/04/06 13:10:43 krw Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -230,8 +230,7 @@ main(int argc, char *argv[])
op = READ;
#endif
- if (argc < 1 || (cflag + dflag > 0) ||
- (fstabfile && op != EDITOR))
+ if (argc < 1 || (fstabfile && op != EDITOR))
usage();
dkname = argv[0];