Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sbin/gpt Pull up following revision(s) (requ...



details:   https://anonhg.NetBSD.org/src/rev/a60dd502e323
branches:  netbsd-8
changeset: 318846:a60dd502e323
user:      snj <snj%NetBSD.org@localhost>
date:      Mon May 07 04:00:18 2018 +0000
description:
Pull up following revision(s) (requested by martin in ticket #797):
        sbin/gpt/gpt.8: 1.60-1.63
        sbin/gpt/header.c: 1.9
Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.
--
Sort sections.
--
Bump date for new EXIT STATUS section.
--
Spello.   (it is "existence").
ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.
I also left a correct spelling that no-one has bothered to mangle!

diffstat:

 sbin/gpt/gpt.8    |  10 ++++++++--
 sbin/gpt/header.c |   4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r bb5e8704a58f -r a60dd502e323 sbin/gpt/gpt.8
--- a/sbin/gpt/gpt.8    Mon May 07 03:51:01 2018 +0000
+++ b/sbin/gpt/gpt.8    Mon May 07 04:00:18 2018 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: gpt.8,v 1.52.4.2 2018/05/04 16:24:46 martin Exp $
+.\" $NetBSD: gpt.8,v 1.52.4.3 2018/05/07 04:00:18 snj Exp $
 .\"
 .\" Copyright (c) 2002 Marcel Moolenaar
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD: src/sbin/gpt/gpt.8,v 1.17 2006/06/22 22:22:32 marcel Exp $
 .\"
-.Dd March 5, 2018
+.Dd May 1, 2018
 .Dt GPT 8
 .Os
 .Sh NAME
@@ -678,6 +678,12 @@
 .Nx
 code in the future.
 .El
+.Sh EXIT STATUS
+The
+.Nm
+command exits with a failure status (1) when the header command
+is used and no GPT header is found.
+This can be used to check for the existence of a GPT in shell scripts.
 .Sh EXAMPLES
 .Bd -literal
 nas# gpt show wd3
diff -r bb5e8704a58f -r a60dd502e323 sbin/gpt/header.c
--- a/sbin/gpt/header.c Mon May 07 03:51:01 2018 +0000
+++ b/sbin/gpt/header.c Mon May 07 04:00:18 2018 +0000
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$NetBSD: header.c,v 1.8 2015/12/24 17:35:57 martin Exp $");
+__RCSID("$NetBSD: header.c,v 1.8.8.1 2018/05/07 04:00:18 snj Exp $");
 #endif
 
 #include <sys/types.h>
@@ -83,7 +83,7 @@
        map = map_find(gpt, MAP_TYPE_PRI_GPT_HDR);
        if (map == NULL) {
                printf("- GPT Header not found\n");
-               return 0;
+               return -1;
        }
 
        hdr = map->map_data;



Home | Main Index | Thread Index | Old Index