pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/newmail Use DT_REG / DT_DIR directly if available...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3deb6de450ea
branches:  trunk
changeset: 506975:3deb6de450ea
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Tue Jan 24 19:08:09 2006 +0000

description:
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:

 mail/newmail/distinfo         |   4 +-
 mail/newmail/patches/patch-aa |  49 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 47 insertions(+), 6 deletions(-)

diffs (69 lines):

diff -r 7fc3690e6352 -r 3deb6de450ea mail/newmail/distinfo
--- a/mail/newmail/distinfo     Tue Jan 24 19:01:45 2006 +0000
+++ b/mail/newmail/distinfo     Tue Jan 24 19:08:09 2006 +0000
@@ -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 -r 7fc3690e6352 -r 3deb6de450ea mail/newmail/patches/patch-aa
--- a/mail/newmail/patches/patch-aa     Tue Jan 24 19:01:45 2006 +0000
+++ b/mail/newmail/patches/patch-aa     Tue Jan 24 19:08:09 2006 +0000
@@ -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() {
  



Home | Main Index | Thread Index | Old Index