diff options
author | peter <peter@FreeBSD.org> | 1996-01-12 08:57:10 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-01-12 08:57:10 +0000 |
commit | 5b70a95cd827978a62482802e9ff51d4e958da7e (patch) | |
tree | 87f917319075f55b3a7df24a1226cb5fd2de48e6 /usr.sbin/config/mkioconf.c | |
parent | b90ef46a2fbc1f210795d01c9dee181dbf3f1922 (diff) | |
download | FreeBSD-src-5b70a95cd827978a62482802e9ff51d4e958da7e.zip FreeBSD-src-5b70a95cd827978a62482802e9ff51d4e958da7e.tar.gz |
Make a little more effort to avoid touching certain generated files if
they were not changed. This makes 'make depend' more useful.
Diffstat (limited to 'usr.sbin/config/mkioconf.c')
-rw-r--r-- | usr.sbin/config/mkioconf.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/config/mkioconf.c b/usr.sbin/config/mkioconf.c index 378b6fb..9eda8f0 100644 --- a/usr.sbin/config/mkioconf.c +++ b/usr.sbin/config/mkioconf.c @@ -608,9 +608,9 @@ i386_ioconf() static char *old_d_name; static char old_shandler[32 + 1]; - fp = fopen(path("ioconf.c"), "w"); + fp = fopen(path("ioconf.c.new"), "w"); if (fp == 0) { - perror(path("ioconf.c")); + perror(path("ioconf.c.new")); exit(1); } fprintf(fp, "/*\n"); @@ -622,9 +622,9 @@ i386_ioconf() fprintf(fp, "#include \"ioconf.h\"\n"); fprintf(fp, "\n"); fprintf(fp, "#define C (caddr_t)\n"); - fp1 = fopen(path("ioconf.h"), "w"); + fp1 = fopen(path("ioconf.h.new"), "w"); if (fp1 == 0) { - perror(path("ioconf.h")); + perror(path("ioconf.h.new")); exit(1); } fprintf(fp1, "/*\n"); @@ -701,6 +701,8 @@ i386_ioconf() fprintf(fp1, "\n"); fprintf(fp1, "#endif /* IOCONF_H */\n"); (void) fclose(fp1); + moveifchanged(path("ioconf.c.new"), path("ioconf.c")); + moveifchanged(path("ioconf.h.new"), path("ioconf.h")); } isa_biotab(fp, table) |