Add an extra param to touch() for nsec

This commit is contained in:
Todd C. Miller
2004-09-07 19:55:37 +00:00
parent 707c3c2cb9
commit 7f772c822f
5 changed files with 10 additions and 9 deletions

View File

@@ -43,15 +43,16 @@ static const char rcsid[] = "$Sudo$";
* Update the access and modify times on an fd or file.
*/
int
touch(fd, path, when)
touch(fd, path, sec, nsec)
int fd;
char *path;
time_t when;
time_t sec;
long nsec;
{
struct timeval times[2];
times[0].tv_sec = times[1].tv_sec = when;
times[0].tv_usec = times[1].tv_usec = 0;
times[0].tv_sec = times[1].tv_sec = sec;
times[0].tv_usec = times[1].tv_usec = nsec;
#if defined(HAVE_FUTIME) || defined(HAVE_FUTIMES)
if (fd != -1)