Make sure mod time on the dump_ok file is updated. (Some systems
authorTheodore Tso <tytso@mit.edu>
Thu, 29 Sep 1994 20:54:22 +0000 (20:54 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 29 Sep 1994 20:54:22 +0000 (20:54 +0000)
don't update the mod-time when a file is opened for writing.)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4384 dc483132-0cff-0310-8789-dd5450dbe970

src/admin/edit/ChangeLog
src/admin/edit/dump.c

index a371de063b85ef4e3fde7a2c6ca806af301e2141..cd5d61d03390611d1d0acfa91c7dfb05e294c4bf 100644 (file)
@@ -1,5 +1,9 @@
 Thu Sep 29 15:52:22 1994  Theodore Y. Ts'o  (tytso@dcl)
 
+       * dump.c (update_ok_file): Make sure mod time on the dump_ok file
+               is updated.  (Some systems don't update the mod-time when
+               a file is opened for writing.)
+
        * Makefile.in: Relink executable when libraries change.
 
        * kdb5_edit.c (show_principal): Pass variable with correct type to
index 5cdf04e5c42fa0b645f9e6763f1661dc3cc31b0a..afc0a8f0e75d422c418f1e0d3fff713570d7ca80 100644 (file)
@@ -182,6 +182,14 @@ void update_ok_file (file_name)
                free(file_ok);
                return;
        }
+       if (write(fd, "", 1) != 1) {
+           com_err(progname, errno, "while writing to 'ok' file, '%s'",
+                   file_ok);
+            exit_status++;
+            free(file_ok);
+            return;
+       }
+
        free(file_ok);
        close(fd);
        return;