summaryrefslogtreecommitdiffstats
path: root/src/setdate.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-11-01 13:38:06 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-11-01 13:38:06 +0100
commit7172224ac4cbe9f4c40db5df505cfe8725108e53 (patch)
tree6b0d5445d46c577975c28b8192c0af39f316d5bc /src/setdate.c
parent9440623c9768c7e235be10ed595149fdb644a911 (diff)
Fix various issues reported by Coverity scan
Diffstat (limited to 'src/setdate.c')
-rw-r--r--src/setdate.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/setdate.c b/src/setdate.c
index dc0c758..d05e716 100644
--- a/src/setdate.c
+++ b/src/setdate.c
@@ -38,23 +38,21 @@
*
* Give a file a particular date and time.
*
- * Return: 1 Success, set the file's date and time
- * 0 Error, failed to change the file's date and time
+ * Return: 0 Success, set the file's date and time
+ * -1 Error, failed to change the file's date and time
*/
int set_date(const char *pathname, time_t actime, time_t modtime)
{
#ifdef HAVE_UTIME
struct utimbuf ut;
if (!pathname)
- return 0;
+ return -1;
ut.actime = actime;
ut.modtime = modtime;
if (utime(pathname, &ut)) {
log_error("ERROR: Couldn't set the file's date and time for %s\n", pathname);
- return 0;
+ return -1;
}
- return 1;
-#else
- return 0;
#endif
+ return 0;
}