Fix return value for tests.

This commit is contained in:
Roy Marples 2009-02-12 10:43:30 +00:00
parent 9f3cf59818
commit 6cc68e21cf

View File

@ -565,27 +565,31 @@ mtime_check(const char *source, const char *target, bool newer,
return true; return true;
if (newer) { if (newer) {
if (mtime < buf.st_mtime) if (mtime < buf.st_mtime) {
if (rel == NULL)
return false;
retval = false; retval = false;
}
if (rel != NULL) { if (rel != NULL) {
if (*rel < buf.st_mtime) { if (*rel < buf.st_mtime) {
if (file) if (file)
strlcpy(file, target, PATH_MAX); strlcpy(file, target, PATH_MAX);
*rel = buf.st_mtime; *rel = buf.st_mtime;
} }
} else }
return retval;
} else { } else {
if (mtime > buf.st_mtime) if (mtime > buf.st_mtime) {
if (rel == NULL)
return false;
retval = false; retval = false;
}
if (rel != NULL) { if (rel != NULL) {
if (*rel > buf.st_mtime) { if (*rel > buf.st_mtime) {
if (file) if (file)
strlcpy(file, target, PATH_MAX); strlcpy(file, target, PATH_MAX);
*rel = buf.st_mtime; *rel = buf.st_mtime;
} }
} else }
return retval;
} }
/* If not a dir then reset errno */ /* If not a dir then reset errno */