diff options
Diffstat (limited to 'src/admin')
| -rw-r--r-- | src/admin/edit/dump.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/admin/edit/dump.c b/src/admin/edit/dump.c index 35f21e610..98220b51c 100644 --- a/src/admin/edit/dump.c +++ b/src/admin/edit/dump.c @@ -98,6 +98,17 @@ void dump_db(argc, argv) return; } if (argc == 2) { + /* + * Make sure that we don't open and truncate on the fopen, + * since that may hose an on-going kprop process. + * + * We could also control this by opening for read and + * write, doing an flock with LOCK_EX, and then + * truncating the file once we have gotten the lock, + * but that would involve more OS dependancies than I + * want to get into. + */ + unlink(argv[1]); if (!(f = fopen(argv[1], "w"))) { com_err(argv[0], errno, "While opening file %s for writing", argv[1]); |
