git: 3958be5c29da - stable/14 - fdisk: emit deprecation notice when run

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 21 Oct 2024 19:09:31 UTC
The branch stable/14 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=3958be5c29dab4abbd7f414f319e11b91db83269

commit 3958be5c29dab4abbd7f414f319e11b91db83269
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-01-24 19:12:21 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-10-21 19:08:13 +0000

    fdisk: emit deprecation notice when run
    
    Requested by:   rgrimes
    Reviewed by:    bapt
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D43585
    
    (cherry picked from commit 86e66321bb18ffc242eac61ed2ae0543d71918a0)
---
 sbin/fdisk/fdisk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index 6cfa2b510f22..a9295b0d1319 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -265,6 +265,10 @@ main(int argc, char *argv[])
 	int	partition = -1;
 	struct	dos_partition *partp;
 
+	fprintf(stderr,
+	    "WARNING: fdisk is deprecated and is not available in FreeBSD 15 or later.\n"
+	    "Please use gpart instead.\n\n");
+
 	while ((c = getopt(argc, argv, "BIab:f:ipqstuv1234")) != -1)
 		switch (c) {
 		case 'B':