diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -250,7 +249,8 @@ } xo_emit("\n"); xo_close_list("key"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); } void @@ -291,7 +291,7 @@ continue; } if ((vent = malloc(sizeof(struct varent))) == NULL) - errx(1, "malloc failed"); + xo_errx(1, "malloc failed"); vent->header = v->header; if (hp) { hp = strdup(hp); @@ -300,13 +300,13 @@ } vent->var = malloc(sizeof(*vent->var)); if (vent->var == NULL) - errx(1, "malloc failed"); + xo_errx(1, "malloc failed"); memcpy(vent->var, v, sizeof(*vent->var)); STAILQ_INSERT_TAIL(&varlist, vent, next_ve); } free(tempstr1); if (STAILQ_EMPTY(&varlist)) { - warnx("no valid keywords; valid keywords:"); + xo_warnx("no valid keywords; valid keywords:"); showkey(); exit(1); } @@ -345,7 +345,7 @@ rflen = strlen(v->alias) + strlen(hp) + 2; realfmt = malloc(rflen); if (realfmt == NULL) - errx(1, "malloc failed"); + xo_errx(1, "malloc failed"); snprintf(realfmt, rflen, "%s=%s", v->alias, hp); parsefmt(realfmt, user); free(realfmt); @@ -353,7 +353,7 @@ return ((VAR *)NULL); } if (!v) { - warnx("%s: keyword not found", p); + xo_warnx("%s: keyword not found", p); eval = 1; } if (header) diff --git a/bin/ps/print.c b/bin/ps/print.c --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -40,7 +40,6 @@ #include #include -#include #include #include #include diff --git a/bin/ps/ps.c b/bin/ps/ps.c --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -46,7 +46,6 @@ #include #include -#include #include #include #include @@ -657,7 +656,8 @@ if (nkept == 0) { printheader(); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); exit(1); } @@ -742,7 +742,8 @@ } xo_close_list("process"); xo_close_container("process-information"); - xo_finish(); + if (xo_finish() < 0) + xo_err(1, "stdout"); free_list(&gidlist); free_list(&jidlist); @@ -812,14 +813,14 @@ int tempid; if (*elem == '\0') { - warnx("Invalid (zero-length) jail id"); + xo_warnx("Invalid (zero-length) jail id"); optfatal = 1; return (0); /* Do not add this value. */ } tempid = jail_getid(elem); if (tempid < 0) { - warnx("Invalid %s: %s", inf->lname, elem); + xo_warnx("Invalid %s: %s", inf->lname, elem); optfatal = 1; return (0); } @@ -1480,7 +1481,7 @@ { #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" - (void)xo_error("%s\n%s\n%s\n%s\n%s\n", + xo_error("%s\n%s\n%s\n%s\n%s\n", "usage: ps [--libxo] " SINGLE_OPTS " [-O fmt | -o fmt]", " [-G gid[,gid...]] [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]",