diff options
author | Russ Cox <rsc@swtch.com> | 2017-10-10 13:49:37 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2017-10-10 13:51:24 -0400 |
commit | 67dbeee5fe9e2a855384048615bafe100e876f4c (patch) | |
tree | f5e2960b2bf7abcc774678b65f947aac792c7fd0 /src/cmd/acme/file.c | |
parent | 680c57a15c51c302d89aec134e25f08820d3f30d (diff) | |
download | plan9port-67dbeee5fe9e2a855384048615bafe100e876f4c.tar.gz plan9port-67dbeee5fe9e2a855384048615bafe100e876f4c.tar.bz2 plan9port-67dbeee5fe9e2a855384048615bafe100e876f4c.zip |
acme: check file content before declaring file "modified since last read"
Bad remote file systems can change mtime unexpectedly,
and then there is the problem that git rebase and similar
operations like to change the files and then change them back,
modifying the mtimes but not the content.
Avoid spurious Put errors on both of those by checking file
content.
(False positive "modified since last read" make the real ones
difficult to notice.)
Diffstat (limited to 'src/cmd/acme/file.c')
-rw-r--r-- | src/cmd/acme/file.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/acme/file.c b/src/cmd/acme/file.c index 00d5d54c..e1eddc46 100644 --- a/src/cmd/acme/file.c +++ b/src/cmd/acme/file.c @@ -8,6 +8,7 @@ #include <frame.h> #include <fcall.h> #include <plumb.h> +#include <libsec.h> #include "dat.h" #include "fns.h" @@ -163,11 +164,11 @@ fileunsetname(File *f, Buffer *delta) } uint -fileload(File *f, uint p0, int fd, int *nulls) +fileload(File *f, uint p0, int fd, int *nulls, DigestState *h) { if(f->seq > 0) error("undo in file.load unimplemented"); - return bufload(&f->b, p0, fd, nulls); + return bufload(&f->b, p0, fd, nulls, h); } /* return sequence number of pending redo */ |