diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1996-06-22 08:05:11 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1996-06-22 08:05:11 +0000 |
commit | 55c148f316e1e2bbc7ac656d7f89144dd9dc34c0 (patch) | |
tree | b0e2ccb38bd7f9b203ffc694a4931d3e97a819b2 /gnu | |
parent | 372fa2cd81a408420aa9235fc9855cdb2d0e3512 (diff) | |
download | src-55c148f316e1e2bbc7ac656d7f89144dd9dc34c0.tar.gz src-55c148f316e1e2bbc7ac656d7f89144dd9dc34c0.zip |
Do not produce empty cat file in debug mode
Notes
Notes:
svn path=/head/; revision=16584
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/man/man/man.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c index 7403534ce02b..510dae6f0ec8 100644 --- a/gnu/usr.bin/man/man/man.c +++ b/gnu/usr.bin/man/man/man.c @@ -1131,7 +1131,9 @@ make_cat_file (path, man_file, cat_file) } } - if (rename(temp, cat_file) == -1) { + if (debug) + unlink(temp); + else if (rename(temp, cat_file) == -1) { s = errno; fprintf(stderr, "\nHmm! Can't seem to rename %s to %s, check permissions on man dir!\n", @@ -1147,13 +1149,19 @@ make_cat_file (path, man_file, cat_file) if (fclose(fp)) { s = errno; - unlink(cat_file); + if (!debug) + unlink(cat_file); fprintf(stderr, "Failed.\n"); errno = s; perror("fclose"); return 0; } + if (debug) { + fprintf(stderr, "No output, debug mode.\n"); + return 0; + } + fprintf(stderr, "Done.\n"); return 1; |