Replace timerfoo macros with timevalfoo since the timer macros are known
to be busted on some systems.
This commit is contained in:
@@ -277,17 +277,13 @@ sudo_edit(struct command_details *command_details, char *argv[], char *envp[])
|
||||
continue;
|
||||
}
|
||||
mtim_get(&sb, &tv);
|
||||
if (tf[i].osize == sb.st_size && timercmp(&tf[i].omtim, &tv, ==)) {
|
||||
if (tf[i].osize == sb.st_size && timevalcmp(&tf[i].omtim, &tv, ==)) {
|
||||
/*
|
||||
* If mtime and size match but the user spent no measurable
|
||||
* time in the editor we can't tell if the file was changed.
|
||||
*/
|
||||
#ifdef HAVE_TIMERSUB2
|
||||
timersub(&tv1, &tv2);
|
||||
#else
|
||||
timersub(&tv1, &tv2, &tv2);
|
||||
#endif
|
||||
if (timerisset(&tv2)) {
|
||||
timevalsub(&tv1, &tv2);
|
||||
if (timevalisset(&tv2)) {
|
||||
warningx("%s unchanged", tf[i].ofile);
|
||||
unlink(tf[i].tfile);
|
||||
close(tfd);
|
||||
|
Reference in New Issue
Block a user