aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2008-02-02 07:19:01 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2008-02-02 07:19:01 +0000
commitc331df4f2324540e80c40ae3b6a2e779a4846d58 (patch)
tree7a297ec86fcc62affeee940704853a4fee51255f
parent974b70c47dcfe49bdaed61e28cc0a409effe71df (diff)
downloadsrc-c331df4f2324540e80c40ae3b6a2e779a4846d58.tar.gz
src-c331df4f2324540e80c40ae3b6a2e779a4846d58.zip
Fix nit in version 4.23 in which -p does not work (thus updating access
times when it shouldn't). The PR's patch has been incorporated upstream as magic.c rev 1.46. PR: 107676 Submitted by: Dr. Markus Waldeck <waldeck@gmx.de>
Notes
Notes: svn path=/vendor/file/dist/; revision=175882
-rw-r--r--contrib/file/magic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/file/magic.c b/contrib/file/magic.c
index 84d7c95d8bbf..8fba30bfab1b 100644
--- a/contrib/file/magic.c
+++ b/contrib/file/magic.c
@@ -218,6 +218,7 @@ close_and_restore(const struct magic_set *ms, const char *name, int fd,
*/
#ifdef HAVE_UTIMES
struct timeval utsbuf[2];
+ memset(utsbuf, 0, sizeof(struct timeval) * 2);
utsbuf[0].tv_sec = sb->st_atime;
utsbuf[1].tv_sec = sb->st_mtime;
@@ -225,6 +226,7 @@ close_and_restore(const struct magic_set *ms, const char *name, int fd,
#elif defined(HAVE_UTIME_H) || defined(HAVE_SYS_UTIME_H)
struct utimbuf utbuf;
+ memset(&utbuf, 0, sizeof(struct utimbuf));
utbuf.actime = sb->st_atime;
utbuf.modtime = sb->st_mtime;
(void) utime(name, &utbuf); /* don't care if loses */