diff --git a/usr.sbin/sesutil/eltsub.c b/usr.sbin/sesutil/eltsub.c --- a/usr.sbin/sesutil/eltsub.c +++ b/usr.sbin/sesutil/eltsub.c @@ -34,7 +34,6 @@ #include -#include #include #include #include diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c --- a/usr.sbin/sesutil/sesutil.c +++ b/usr.sbin/sesutil/sesutil.c @@ -39,7 +39,6 @@ #include #include -#include #include #include #include @@ -544,7 +543,8 @@ free(e_desc.elm_desc_str); xo_close_list("enclosures"); xo_close_container("sesutil"); - xo_finish(); + if (xo_finish() < 0) + xo_err(EXIT_FAILURE, "stdout"); return (EXIT_SUCCESS); } @@ -589,7 +589,7 @@ comma = (int)strcspn(devnames, ","); asprintf(&tmp, "/dev/%.*s", comma, devnames); if (tmp == NULL) - err(1, "asprintf"); + xo_err(1, "asprintf"); fd = open(tmp, O_RDONLY); free(tmp); if (fd < 0) { @@ -873,7 +873,8 @@ free(e_desc.elm_desc_str); xo_close_list("enclosures"); xo_close_container("sesutil"); - xo_finish(); + if (xo_finish() < 0) + xo_err(EXIT_FAILURE, "stdout"); return (EXIT_SUCCESS); } @@ -965,7 +966,8 @@ xo_close_list("enclosures"); xo_close_container("sesutil"); - xo_finish(); + if (xo_finish() < 0) + xo_err(EXIT_FAILURE, "stdout"); if (status == 1) { return (EXIT_SUCCESS); @@ -982,7 +984,7 @@ argc = xo_parse_args(argc, argv); if (argc < 0) - exit(1); + exit(EXIT_FAILURE); uflag = "/dev/ses[0-9]*"; while ((ch = getopt_long(argc, argv, "u:", NULL, NULL)) != -1) { @@ -999,7 +1001,7 @@ argv += optind; if (argc < 1) { - warnx("Missing command"); + xo_warnx("Missing command"); usage(stderr, NULL); } @@ -1011,7 +1013,7 @@ } if (cmd == NULL) { - warnx("unknown command %s", argv[0]); + xo_warnx("unknown command %s", argv[0]); usage(stderr, NULL); }