diff options
author | Chet Ramey <chet.ramey@case.edu> | 2014-02-26 09:36:43 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2014-02-26 09:36:43 -0500 |
commit | ac50fbac377e32b98d2de396f016ea81e8ee9961 (patch) | |
tree | f71882366b98fedf1a88a063103219a4935de926 /mailcheck.c | |
parent | 4539d736f1aff232857a854fd2a68df0c98d9f34 (diff) | |
download | android_external_bash-ac50fbac377e32b98d2de396f016ea81e8ee9961.tar.gz android_external_bash-ac50fbac377e32b98d2de396f016ea81e8ee9961.tar.bz2 android_external_bash-ac50fbac377e32b98d2de396f016ea81e8ee9961.zip |
Bash-4.3 distribution sources and documentation
Diffstat (limited to 'mailcheck.c')
-rw-r--r-- | mailcheck.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mailcheck.c b/mailcheck.c index bd95f0d..c04d0fe 100644 --- a/mailcheck.c +++ b/mailcheck.c @@ -23,7 +23,7 @@ #include <stdio.h> #include "bashtypes.h" #include "posixstat.h" -#ifndef _MINIX +#if defined (HAVE_SYS_PARAM_H) # include <sys/param.h> #endif #if defined (HAVE_UNISTD_H) @@ -267,7 +267,10 @@ file_mod_date_changed (i) file = mailfiles[i]->name; mtime = mailfiles[i]->mod_time; - if ((mailstat (file, &finfo) == 0) && (finfo.st_size > 0)) + if (mailstat (file, &finfo) != 0) + return (0); + + if (finfo.st_size > 0) return (mtime < finfo.st_mtime); if (finfo.st_size == 0 && mailfiles[i]->file_size > 0) @@ -288,7 +291,10 @@ file_access_date_changed (i) file = mailfiles[i]->name; atime = mailfiles[i]->access_time; - if ((mailstat (file, &finfo) == 0) && (finfo.st_size > 0)) + if (mailstat (file, &finfo) != 0) + return (0); + + if (finfo.st_size > 0) return (atime < finfo.st_atime); return (0); |