summaryrefslogtreecommitdiff
path: root/sbin/fdisk/misc.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-11-08 23:22:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-11-08 23:22:27 +0000
commit08f0be3b9161ed0e33d43893aff9b10ee6ecf07b (patch)
treea887aa9f2696b1e1400120cd389007a737f0f61b /sbin/fdisk/misc.c
parent9531f4ad38bdd9fac9f312c6f010c8ff3f21cf25 (diff)
add a -y flag, for non-interactive use
Diffstat (limited to 'sbin/fdisk/misc.c')
-rw-r--r--sbin/fdisk/misc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/fdisk/misc.c b/sbin/fdisk/misc.c
index 3c9be4c0e2c..7909aaef717 100644
--- a/sbin/fdisk/misc.c
+++ b/sbin/fdisk/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.17 2006/10/24 17:30:45 moritz Exp $ */
+/* $OpenBSD: misc.c,v 1.18 2006/11/08 23:22:26 deraadt Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -139,6 +139,10 @@ int
ask_yn(const char *str)
{
int ch, first;
+ extern int y_flag;
+
+ if (y_flag)
+ return (1);
printf("%s [n] ", str);
fflush(stdout);