halt/reboot/poweroff: improve error reporting
function old new delta halt_main 207 185 -22
This commit is contained in:
parent
a6b6f05379
commit
fb1a23d73b
@ -887,7 +887,7 @@ extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, f
|
|||||||
extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
|
extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
|
||||||
extern void bb_simple_perror_msg(const char *s) FAST_FUNC;
|
extern void bb_simple_perror_msg(const char *s) FAST_FUNC;
|
||||||
extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
|
extern void bb_perror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
|
||||||
extern void bb_simple_perror_msg_and_die(const char *s) __attribute__ ((noreturn)) FAST_FUNC;
|
extern void bb_simple_perror_msg_and_die(const char *s) NORETURN FAST_FUNC;
|
||||||
extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
|
extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))) FAST_FUNC;
|
||||||
extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
|
extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))) FAST_FUNC;
|
||||||
extern void bb_perror_nomsg_and_die(void) NORETURN FAST_FUNC;
|
extern void bb_perror_nomsg_and_die(void) NORETURN FAST_FUNC;
|
||||||
|
@ -95,6 +95,6 @@ int halt_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
rc = reboot(magic[which]);
|
rc = reboot(magic[which]);
|
||||||
|
|
||||||
if (rc)
|
if (rc)
|
||||||
bb_error_msg("no");
|
bb_perror_nomsg_and_die();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user