From 2b27cdd369ab0e623e54641c85ec9c37d976ae10 Mon Sep 17 00:00:00 2001 From: krw Date: Sun, 13 Jun 2021 15:32:36 +0000 Subject: [PATCH] Have gedit() and gsetpid() both return CMD_CLEAN if no data has changed, thus keeping the modified indicator correct and avoiding early bailout when editing a gpt partition w/o changing the type. --- sbin/fdisk/cmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index 8c151c6c89c..e0627d28ba9 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.113 2021/06/13 14:39:05 krw Exp $ */ +/* $OpenBSD: cmd.c,v 1.114 2021/06/13 15:32:36 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -197,6 +197,8 @@ gedit(int pn) if (memcmp(gg, &oldgg, sizeof(*gg))) return (CMD_DIRTY); + else + return (CMD_CLEAN); done: *gg = oldgg; @@ -329,6 +331,8 @@ gsetpid(int pn) if (memcmp(gg, &oldgg, sizeof(*gg))) return (CMD_DIRTY); + else + return (CMD_CLEAN); done: *gg = oldgg; -- 2.20.1