diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-05-08 13:47:41 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-05-08 14:11:45 -0700 |
commit | 1aa61c2e6e03625813d3e6283e166f82c7bc4b9c (patch) | |
tree | 3e02f1fdcc419d4fedd059e61f980bf3cf6b9f60 /editmsg.c | |
parent | 0829476975d24a795b7164ad8a3d9e9f0331452f (diff) |
Improve mutt_decrease_mtime() error handling.
Add a check for utime failure. Some non-posix implementations return
EINTR. Since editing messages is a very common operation in Mutt,
take care to retry in that case so as not to introduce message
composition failures.
Make sure all callers check mutt_decrease_mtime()'s return value,
since stat could also fail.
Diffstat (limited to 'editmsg.c')
-rw-r--r-- | editmsg.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -123,7 +123,12 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) goto bail; } - mtime = mutt_decrease_mtime (mutt_b2s (tmp), &sb); + if ((mtime = mutt_decrease_mtime (mutt_b2s (tmp), &sb)) == (time_t) -1) + { + rc = -1; + mutt_perror (mutt_b2s (tmp)); + goto bail; + } mutt_edit_file (NONULL(Editor), mutt_b2s (tmp)); |