diff options
author | joerg <joerg@pkgsrc.org> | 2006-01-24 19:08:09 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2006-01-24 19:08:09 +0000 |
commit | e66e7298baf09d1de0fe8bc4d4ff49c57ceb78f9 (patch) | |
tree | f37bf83337bf38fa38b5731a0a5a2c56021235e2 /mail/newmail | |
parent | 5d4e64d9b6362b173f3473f004f832e03988f33e (diff) | |
download | pkgsrc-e66e7298baf09d1de0fe8bc4d4ff49c57ceb78f9.tar.gz |
Use DT_REG / DT_DIR directly if available and fall back to DTTOIF
if not. Bail out with an explicit error if none is present.
Diffstat (limited to 'mail/newmail')
-rw-r--r-- | mail/newmail/distinfo | 4 | ||||
-rw-r--r-- | mail/newmail/patches/patch-aa | 49 |
2 files changed, 47 insertions, 6 deletions
diff --git a/mail/newmail/distinfo b/mail/newmail/distinfo index 9db027c6a99..622d666513a 100644 --- a/mail/newmail/distinfo +++ b/mail/newmail/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.3 2005/02/24 09:59:25 agc Exp $ +$NetBSD: distinfo,v 1.4 2006/01/24 19:08:09 joerg Exp $ SHA1 (newmail-1.0.1.tar.gz) = 031387e2ba10e5e4ba801dab25d86fce3b55e02c RMD160 (newmail-1.0.1.tar.gz) = 411e94b61909400a580fbad887f1ad730738679e Size (newmail-1.0.1.tar.gz) = 3476 bytes -SHA1 (patch-aa) = a0937e803e029fa53351a18cad47a0f05a85e4a0 +SHA1 (patch-aa) = 3d81434a8d98390df7964cc701c83496791de267 diff --git a/mail/newmail/patches/patch-aa b/mail/newmail/patches/patch-aa index 3508bae8240..4c472a0cc39 100644 --- a/mail/newmail/patches/patch-aa +++ b/mail/newmail/patches/patch-aa @@ -1,8 +1,49 @@ -$NetBSD: patch-aa,v 1.1 2004/05/23 23:35:12 kristerw Exp $ +$NetBSD: patch-aa,v 1.2 2006/01/24 19:08:09 joerg Exp $ ---- newmail.c.orig 2004-05-24 01:29:15.000000000 +0200 -+++ newmail.c 2004-05-24 01:32:01.000000000 +0200 -@@ -148,19 +148,19 @@ +--- newmail.c.orig 1999-10-14 04:49:42.000000000 +0000 ++++ newmail.c +@@ -28,6 +28,22 @@ + static void usage(); + static void version(); + ++#ifdef DT_REG ++#define DIRENT_IS_REG(x) ((x) == DT_REG) ++#elif defined(DTTOIF) ++#define DIRENT_IS_REG(x) (S_ISREG(DTTOIF((x)))) ++#else ++#error "Neither DT_REG nor DTTOIF is defined." ++#endif ++ ++#ifdef DT_DIR ++#define DIRENT_IS_DIR(x) ((x) == DT_DIR) ++#elif defined(DTTOIF) ++#define DIRENT_IS_DIR(x) (S_ISDIR(DTTOIF((x)))) ++#else ++#error "Neither DT_REG nor DTTOIF is defined." ++#endif ++ + unsigned char no_mail_message, + individual_messages, + use_exit_val; +@@ -98,7 +114,7 @@ int main(int argc, char *argv[]) { + continue; + } + /* see if its a regular file */ +- if (S_ISREG(DTTOIF(curr_file->d_type))) { ++ if (DIRENT_IS_REG(curr_file->d_type)) { + /* stat it for check_mailbox */ + if (stat(curr_file->d_name, &file_info) == -1) { + err(EX_NOINPUT, "couldn't stat %s/%s", argv[ui], curr_file->d_name); +@@ -106,7 +122,7 @@ int main(int argc, char *argv[]) { + check_mailbox(curr_file->d_name, &file_info, &found_mail); + } else if (warn_non_regular) { + /* just check its not a directory before warning */ +- if (! S_ISDIR(DTTOIF(curr_file->d_type))) { ++ if (! DIRENT_IS_DIR(curr_file->d_type)) { + warnx("Found %s/%s: Not a regular file", argv[ui], curr_file->d_name); + } + } /* end of is dirent a regular file */ +@@ -148,19 +164,19 @@ void check_mailbox(const char *const fn, static void usage() { |