From 1a83879f7485d4127f77f61caa00d2ce35a354fb Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 2 Oct 1997 14:58:32 +0000 Subject: do not whine if user quits without mods --- sbin/fdisk/cmd.c | 6 +++++- sbin/fdisk/user.c | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index 1be44585835..4cf6a73a61a 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.3 1997/09/30 00:07:25 mickey Exp $ */ +/* $OpenBSD: cmd.c,v 1.4 1997/10/02 14:58:30 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -263,6 +263,10 @@ Xquit(cmd, disk, mbr, tt, offset) mbr_t *tt; int offset; { + extern int modified; + + if (modified == 0) + exit(0); if(ask_yn("You really want to quit?")) exit(0); diff --git a/sbin/fdisk/user.c b/sbin/fdisk/user.c index 86e54992e31..2e40a0fa260 100644 --- a/sbin/fdisk/user.c +++ b/sbin/fdisk/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.5 1997/10/02 14:55:30 deraadt Exp $ */ +/* $OpenBSD: user.c,v 1.6 1997/10/02 14:58:31 deraadt Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -109,6 +109,8 @@ USER_init(disk, tt) return(0); } +int modified; + int USER_modify(disk, tt, offset) disk_t *disk; @@ -118,7 +120,7 @@ USER_modify(disk, tt, offset) char mbr_buf[DEV_BSIZE]; mbr_t mbr; cmd_t cmd; - int i, st, fd, modified = 0; + int i, st, fd; /* Set up command table pointer */ -- cgit v1.2.3