aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/unix
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2011-12-02 18:50:00 +0100
committerBjörn-Egil Dahlberg <[email protected]>2011-12-08 14:12:01 +0100
commit24f661ade9375e2489d3f07fd7f0113da3593a05 (patch)
tree68fb6b250533a2854a1ecaa9eaa0a0daa5043bdf /erts/emulator/drivers/unix
parent1d603bc4e80cbb3d23da61a55cee0fb8e67d72fb (diff)
downloadotp-24f661ade9375e2489d3f07fd7f0113da3593a05.tar.gz
otp-24f661ade9375e2489d3f07fd7f0113da3593a05.tar.bz2
otp-24f661ade9375e2489d3f07fd7f0113da3593a05.zip
unix_efile: Zero is a valid number in utime
Both mtime and atime were incorrectly checked for zero
Diffstat (limited to 'erts/emulator/drivers/unix')
-rw-r--r--erts/emulator/drivers/unix/unix_efile.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c
index 0237c81e1e..2e6aa15b06 100644
--- a/erts/emulator/drivers/unix/unix_efile.c
+++ b/erts/emulator/drivers/unix/unix_efile.c
@@ -952,24 +952,20 @@ efile_write_info(Efile_error *errInfo, Efile_info *pInfo, char *name)
#endif /* !VXWORKS */
- if (pInfo->accessTime != 0 && pInfo->modifyTime != 0) {
- struct utimbuf tval;
- struct tm timebuf;
+ struct utimbuf tval;
- tval.actime = pInfo->accessTime;
- tval.modtime = pInfo->modifyTime;
+ tval.actime = pInfo->accessTime;
+ tval.modtime = pInfo->modifyTime;
#ifdef VXWORKS
- /* VxWorks' utime doesn't work when the file is a nfs mounted
- * one, don't report error if utime fails.
- */
- utime(name, &tval);
- return 1;
+ /* VxWorks' utime doesn't work when the file is a nfs mounted
+ * one, don't report error if utime fails.
+ */
+ utime(name, &tval);
+ return 1;
#else
- return check_error(utime(name, &tval), errInfo);
+ return check_error(utime(name, &tval), errInfo);
#endif
- }
- return 1;
}