getconf: Ensure output was written successfully

This commit is contained in:
Michael Forney 2017-09-03 17:26:04 -07:00
parent c225d88d49
commit b524eb6f3d

View File

@ -51,7 +51,7 @@ main(int argc, char *argv[])
} else { } else {
printf("%ld\n", res); printf("%ld\n", res);
} }
return 0; return fshut(stdout, "<stdout>");
} }
/* confstr */ /* confstr */
for (i = 0; i < LEN(confstr_l); i++) { for (i = 0; i < LEN(confstr_l); i++) {
@ -74,14 +74,14 @@ main(int argc, char *argv[])
} }
free(str); free(str);
} }
return 0; return fshut(stdout, "<stdout>");
} }
/* limits */ /* limits */
for (i = 0; i < LEN(limits_l); i++) { for (i = 0; i < LEN(limits_l); i++) {
if (strcmp(argv[0], limits_l[i].k)) if (strcmp(argv[0], limits_l[i].k))
continue; continue;
printf("%ld\n", limits_l[i].v); printf("%ld\n", limits_l[i].v);
return 0; return fshut(stdout, "<stdout>");
} }
} else if (argc == 2) { } else if (argc == 2) {
/* pathconf */ /* pathconf */
@ -96,7 +96,7 @@ main(int argc, char *argv[])
} else { } else {
printf("%ld\n", res); printf("%ld\n", res);
} }
return 0; return fshut(stdout, "<stdout>");
} }
} else { } else {
usage(); usage();