diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-09-08 21:41:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-12 13:28:21 (GMT) |
commit | 8f324c7cefea75a12c0f58977177edf263f42e9f (patch) | |
tree | 7b826de9d348220df0d400d4a230ff2c444a1046 /Source/cmSystemTools.cxx | |
parent | 5d3b5bef11bc29bb00a14103433fea81e4dcc340 (diff) | |
download | CMake-8f324c7cefea75a12c0f58977177edf263f42e9f.zip CMake-8f324c7cefea75a12c0f58977177edf263f42e9f.tar.gz CMake-8f324c7cefea75a12c0f58977177edf263f42e9f.tar.bz2 |
cmSystemTools: simplify boolean expressions
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 7da9975..7352217 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1766,9 +1766,7 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile) if (!GetFileTime(hFrom, &timeCreation, &timeLastAccess, &timeLastWrite)) { return false; } - if (!SetFileTime(hTo, &timeCreation, &timeLastAccess, &timeLastWrite)) { - return false; - } + return SetFileTime(hTo, &timeCreation, &timeLastAccess, &timeLastWrite) != 0; #else struct stat fromStat; if (stat(fromFile, &fromStat) < 0) { @@ -1778,11 +1776,8 @@ bool cmSystemTools::CopyFileTime(const char* fromFile, const char* toFile) struct utimbuf buf; buf.actime = fromStat.st_atime; buf.modtime = fromStat.st_mtime; - if (utime(toFile, &buf) < 0) { - return false; - } + return utime(toFile, &buf) >= 0; #endif - return true; } cmSystemToolsFileTime* cmSystemTools::FileTimeNew() @@ -1828,16 +1823,11 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) if (!h) { return false; } - if (!SetFileTime(h, &t->timeCreation, &t->timeLastAccess, - &t->timeLastWrite)) { - return false; - } + return SetFileTime(h, &t->timeCreation, &t->timeLastAccess, + &t->timeLastWrite) != 0; #else - if (utime(fname, &t->timeBuf) < 0) { - return false; - } + return utime(fname, &t->timeBuf) >= 0; #endif - return true; } #ifdef _WIN32 |