sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit b524eb6f3d03536ef6b091b436692292e5c59da9
parent c225d88d49f5cfd3c6e562700131cc7006d6d57a
Author: Michael Forney <mforney@mforney.org>
Date:   Sun,  3 Sep 2017 17:26:04 -0700

getconf: Ensure output was written successfully

Diffstat:
Mgetconf.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

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