From: dfffffff Date: Wed, 31 Aug 2016 12:11:16 +0000 (-0400) Subject: usage now outputs to stderr X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5c97c0898b64e49562012645a9fde9c4f2acbb19;p=FUZIX.git usage now outputs to stderr --- diff --git a/Applications/util/uname.c b/Applications/util/uname.c index 52ed3269..669c6995 100644 --- a/Applications/util/uname.c +++ b/Applications/util/uname.c @@ -27,6 +27,7 @@ #include #include +int fd; char *argv0, aflag, mflag, rflag, sflag, vflag, next; void error(void) @@ -40,7 +41,7 @@ void putstr(char *str) ssize_t ret, len; len = strlen(str); while (len > 0) { - ret = write(STDOUT_FILENO, str, len); + ret = write(fd, str, len); if (ret == -1) error(); str += ret; @@ -50,6 +51,7 @@ void putstr(char *str) void usage(void) { + fd = STDERR_FILENO; putstr("usage: "); putstr(argv0); putstr(" [-amrsv]\n"); @@ -70,6 +72,7 @@ int main(int argc, char *argv[]) char *p; int i; + fd = STDOUT_FILENO; argv0 = ""; if (argc) { argv0 = argv[0];