Date: Fri, 23 Mar 2007 10:58:32 GMT From: Tom Judge<tom@tomjudge.com> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/110705: gmirror control utility does not exit with correct exit status Message-ID: <200703231058.l2NAwW1R019800@www.freebsd.org> Resent-Message-ID: <200703231110.l2NBA3hc025168@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 110705 >Category: bin >Synopsis: gmirror control utility does not exit with correct exit status >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 23 11:10:03 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Tom Judge >Release: 6.2 Release >Organization: >Environment: When requesting the gmirror status of a non existant device the gmirror utility exits with a 0 exit status which according to the man page indicates that the command completed successfuly. >From man 8 gmirror: EXIT STATUS Exit status is 0 on success, and 1 if the command fails. I would have thought the command has failed if the device of whom the status is being requested does not exist. >Description: When requesting the gmirror status of a non existant device the gmirror utility exits with a 0 exit status which according to the man page indicates that the command completed successfuly. >From man 8 gmirror: EXIT STATUS Exit status is 0 on success, and 1 if the command fails. I would have thought the command has failed if the device of whom the status is being requested does not exist. >How-To-Repeat: Assuming gm0 is not an active gmirror device, and is not listed in the output of "gmirror status" gmirror status gm0; echo $? No such geom: gm0. 0 >Fix: It would seem that the gctl_req structure has members that allow for storing of error states perhapse these could be used in the cases where error conditions are found (std_list, std_status etc...). Or exit(EXIT_FAILURE) could be called. >From sbin/geom/core/geom.c I seems that neither "Class not found" or "No such geom" cause exit(EXIT_FAILURE), where ase "Cannon get GEOM tree" does. >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703231058.l2NAwW1R019800>