Replace timerfoo macros with timevalfoo since the timer macros are known

to be busted on some systems.
This commit is contained in:
Todd C. Miller
2010-06-08 18:38:23 -04:00
parent 0be6bab05c
commit 79f178923e
9 changed files with 48 additions and 100 deletions

View File

@@ -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);