summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-06-22 08:05:11 +0000
committerache <ache@FreeBSD.org>1996-06-22 08:05:11 +0000
commit1649c2ccee0c009a07ac7e86ad4c7681345a7c24 (patch)
treeb0e2ccb38bd7f9b203ffc694a4931d3e97a819b2
parent35d746f862db528264519e940b32674de4606851 (diff)
downloadFreeBSD-src-1649c2ccee0c009a07ac7e86ad4c7681345a7c24.zip
FreeBSD-src-1649c2ccee0c009a07ac7e86ad4c7681345a7c24.tar.gz
Do not produce empty cat file in debug mode
-rw-r--r--gnu/usr.bin/man/man/man.c12
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 7403534..510dae6 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;
OpenPOWER on IntegriCloud