Source-Changes-HG archive

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

[src/trunk]: src/sbin/nvmectl In "devlist" mode, exit with a 0 return code if...



details:   https://anonhg.NetBSD.org/src/rev/c6f7aa3915eb
branches:  trunk
changeset: 373843:c6f7aa3915eb
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sun Mar 05 23:24:06 2023 +0000

description:
In "devlist" mode, exit with a 0 return code if any nvme devices are
found, rather than exiting with 1 return code always.

diffstat:

 sbin/nvmectl/devlist.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r dcb123ae9679 -r c6f7aa3915eb sbin/nvmectl/devlist.c
--- a/sbin/nvmectl/devlist.c    Sun Mar 05 22:37:17 2023 +0000
+++ b/sbin/nvmectl/devlist.c    Sun Mar 05 23:24:06 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devlist.c,v 1.5 2018/04/18 10:11:44 nonaka Exp $       */
+/*     $NetBSD: devlist.c,v 1.6 2023/03/05 23:24:06 simonb Exp $       */
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: devlist.c,v 1.5 2018/04/18 10:11:44 nonaka Exp $");
+__RCSID("$NetBSD: devlist.c,v 1.6 2023/03/05 23:24:06 simonb Exp $");
 #if 0
 __FBSDID("$FreeBSD: head/sbin/nvmecontrol/devlist.c 329824 2018-02-22 13:32:31Z wma $");
 #endif
@@ -118,8 +118,10 @@
                close(fd);
        }
 
-       if (found == 0)
+       if (found == 0) {
                printf("No NVMe controllers found.\n");
+               exit(1);
+       }
 
-       exit(1);
+       exit(0);
 }



Home | Main Index | Thread Index | Old Index