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 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.
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 case "Cannot get GEOM tree"
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.
Assign to GEOM team.
Fix committed to HEAD, MFC in 2 weeks. Thanks!
pjd 2007-03-23 21:05:36 UTC
FreeBSD src repository
Exit status should be 1 on error.
Reported by: Tom Judge
MFC after: 2 weeks
Revision Changes Path
1.28 +5 -8 src/sbin/geom/core/geom.c
email@example.com mailing list
To unsubscribe, send any mail to "firstname.lastname@example.org"
MFC to RELENG_6 missing! If done, this PR can be closed.
Patch committed in RELENG_ and HEAD. Thanks!.
Oops, this requires a MFC to 6
This has been fixed in 7+, and with 6-STABLE going EOL next month, the
submitter is happy for this to be closed.