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. 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 case "Cannot get GEOM tree" does. 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
Responsible Changed From-To: freebsd-bugs->freebsd-geom Assign to GEOM team.
State Changed From-To: open->patched Fix committed to HEAD, MFC in 2 weeks. Thanks!
pjd 2007-03-23 21:05:36 UTC FreeBSD src repository Modified files: sbin/geom/core geom.c Log: Exit status should be 1 on error. PR: bin/110705 Reported by: Tom Judge MFC after: 2 weeks Revision Changes Path 1.28 +5 -8 src/sbin/geom/core/geom.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
MFC to RELENG_6 missing! If done, this PR can be closed.
State Changed From-To: patched->closed Patch committed in RELENG_[67] and HEAD. Thanks!.
State Changed From-To: closed->patched Oops, this requires a MFC to 6
State Changed From-To: patched->closed This has been fixed in 7+, and with 6-STABLE going EOL next month, the submitter is happy for this to be closed.