Handle systems like AIX that lack a way to set the modification

time on open fds.
This commit is contained in:
Todd C. Miller
2014-06-27 11:47:16 -06:00
parent 1ee8afe1b4
commit 2be0929f22

View File

@@ -216,7 +216,11 @@ sudo_edit(struct command_details *command_details)
*/
times[0].tv_sec = times[1].tv_sec = tf[j].omtim.tv_sec;
times[0].tv_usec = times[1].tv_usec = tf[j].omtim.tv_usec;
#ifdef HAVE_FUTIMES
(void) futimes(tfd, times);
#else
(void) utimes(tf[j].tfile, times);
#endif
rc = fstat(tfd, &sb);
if (!rc)
mtim_get(&sb, &tf[j].omtim);