diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2002-03-12 01:18:50 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2002-03-12 01:18:50 +0000 |
commit | 03e039820dc5092e27e81f3671652f25da7f25f1 (patch) | |
tree | 37bddad6951b8a6aa5d75184353705f672217812 /libc/stdio/perror.c | |
parent | ff3e48d94097ed02480bb0df538620b221ccd72f (diff) |
Swap in the new stdio code.
Diffstat (limited to 'libc/stdio/perror.c')
-rw-r--r-- | libc/stdio/perror.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/libc/stdio/perror.c b/libc/stdio/perror.c deleted file mode 100644 index 33b5e08b0..000000000 --- a/libc/stdio/perror.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <string.h> -#include <stdio.h> -#include <errno.h> - -/* - * Manuel Novoa III Feb 2001 - * - * Replaced old version that did write(2,...)'s with a version using - * stream functions. If the program is calling perror, it's a safe - * bet that printf and friends are used as well. It is also possible - * that the calling program could buffer stderr, or reassign it. - * Also, the old version did not conform the standards when the - * passed char * was either NULL or pointed to an empty string. - */ - -void perror(__const char *str) -{ - static const char perror_str[] = ": "; - const char *sep; - - sep = perror_str; - if (!(str && *str)) { /* Caller did not supply a prefix message */ - sep += 2; /* or passed an empty string. */ - str = sep; - } - fprintf(stderr, "%s%s%s\n", str, sep, strerror(errno)); -} |