If you can modify p_cpg in when 'm'odifying a partition, you should be
authorkrw <krw@openbsd.org>
Sat, 24 Feb 2018 21:00:00 +0000 (21:00 +0000)
committerkrw <krw@openbsd.org>
Sat, 24 Feb 2018 21:00:00 +0000 (21:00 +0000)
able to do the same when 'a'dding a partition. Only in 'X'pert mode
of course.

ok otto@

sbin/disklabel/editor.c

index 0d449d1..2f64475 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: editor.c,v 1.311 2018/02/23 21:39:58 krw Exp $        */
+/*     $OpenBSD: editor.c,v 1.312 2018/02/24 21:00:00 krw Exp $        */
 
 /*
  * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -901,7 +901,8 @@ editor_add(struct disklabel *lp, char *p)
                if (get_fstype(lp, partno) == 0 &&
                    get_mp(lp, partno) == 0 &&
                    get_fsize(lp, partno) == 0  &&
-                   get_bsize(lp, partno) == 0)
+                   get_bsize(lp, partno) == 0 &&
+                   get_cpg(lp, partno) == 0)
                        return;
        }
        /* Bailed out at some point, so effectively delete the partition. */