Send inn-committers mailing list submissions to
        inn-committers@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/inn-committers
or, via email, send a message with subject or body 'help' to
        inn-committers-requ...@lists.isc.org

You can reach the person managing the list at
        inn-committers-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-committers digest..."


Today's Topics:

   1. INN commit: branches/2.5/contrib (Makefile README
      auth_pass.c) (INN Commit)
   2. INN commit: branches/2.5/contrib (expirectl.c) (INN Commit)
   3. INN commit: branches/2.5 (4 files) (INN Commit)
   4. INN commit: branches/2.5/contrib (reset-cnfs.c) (INN Commit)
   5. INN commit: branches/2.5/contrib (Makefile respool.c) (INN Commit)
   6. INN commit: trunk (Makefile) (INN Commit)


----------------------------------------------------------------------

Message: 1
Date: Sun, 21 Sep 2014 05:36:41 -0700 (PDT)
From: INN Commit <r...@isc.org>
To: inn-committ...@isc.org
Subject: INN commit: branches/2.5/contrib (Makefile README
        auth_pass.c)
Message-ID: <20140921123641.7501167...@hope.eyrie.org>

    Date: Sunday, September 21, 2014 @ 05:36:41
  Author: iulius
Revision: 9707

Add compilation rules for contrib/auth_pass.c and contrib/expirectl.c

Use the right socklen_t type, and add crypt.h header if available.

Modified:
  branches/2.5/contrib/Makefile
  branches/2.5/contrib/README
  branches/2.5/contrib/auth_pass.c

-------------+
 Makefile    |    4 +++-
 README      |    5 +++++
 auth_pass.c |    7 ++++++-
 3 files changed, 14 insertions(+), 2 deletions(-)

Modified: Makefile
===================================================================
--- Makefile    2014-09-21 12:31:25 UTC (rev 9706)
+++ Makefile    2014-09-21 12:36:41 UTC (rev 9707)
@@ -9,7 +9,8 @@
 top           = ..
 CFLAGS        = $(GCFLAGS)
 
-ALL          = archivegz backlogstat cleannewsgroups delayer \
+ALL          = archivegz auth_pass backlogstat cleannewsgroups \
+               delayer expirectl \
                findreadgroups makeexpctl makestorconf mlockfile newsresp \
                pullart reset-cnfs respool stathist thdexpire \
                tunefeed
@@ -35,6 +36,7 @@
 
 STORELIBS      = $(LIBSTORAGE) $(LIBINN) $(STORAGE_LIBS) $(LIBS)
 
+auth_pass:     auth_pass.o     ; $(LINK) auth_pass.o $(LIBINN) $(CRYPT_LIBS)
 expirectl:     expirectl.o     ; $(LINK) expirectl.o
 mlockfile:     mlockfile.o     ; $(LINK) mlockfile.o
 newsresp:      newsresp.o      ; $(LINK) newsresp.o $(LIBS)

Modified: README
===================================================================
--- README      2014-09-21 12:31:25 UTC (rev 9706)
+++ README      2014-09-21 12:36:41 UTC (rev 9707)
@@ -40,6 +40,11 @@
     database.  Could also be easily modified to check against any other
     type of database that Perl's DBI module can talk to.
 
+auth_pass
+
+    A sample authorization program for use with the (deprecated) AUTHINFO
+    GENERIC command in nnrpd.
+
 backlogstat
 
     Prints informations about the current state of innfeed's backlog, if

Modified: auth_pass.c
===================================================================
--- auth_pass.c 2014-09-21 12:31:25 UTC (rev 9706)
+++ auth_pass.c 2014-09-21 12:36:41 UTC (rev 9707)
@@ -39,7 +39,12 @@
 #include <netdb.h>
 #include <pwd.h>
 
+#if HAVE_CRYPT_H
+# include <crypt.h>
+#endif
 
+
+int
 main(int argc, char** argv)
 /*+
  * Abstract:
@@ -64,7 +69,7 @@
  */
 {
     struct hostent *   hp;
-    int                        length;
+    socklen_t                  length;
     char               password[256];
     char               peername[1024];
     struct passwd *    pwd;



------------------------------

Message: 2
Date: Sun, 21 Sep 2014 05:38:19 -0700 (PDT)
From: INN Commit <r...@isc.org>
To: inn-committ...@isc.org
Subject: INN commit: branches/2.5/contrib (expirectl.c)
Message-ID: <20140921123819.b1de167...@hope.eyrie.org>

    Date: Sunday, September 21, 2014 @ 05:38:19
  Author: iulius
Revision: 9708

Fix build of contrib/expirectl.c

Add correct include header files, and fix a few warnings in printf() calls.

Add portability code for statfs/statvfs support.

Modified:
  branches/2.5/contrib/expirectl.c

-------------+
 expirectl.c |   74 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 56 insertions(+), 18 deletions(-)

Modified: expirectl.c
===================================================================
--- expirectl.c 2014-09-21 12:36:41 UTC (rev 9707)
+++ expirectl.c 2014-09-21 12:38:19 UTC (rev 9708)
@@ -31,14 +31,52 @@
  *     will not really exercise the program for another 14 days or so :-).
  */
 
-
-#include <sys/types.h>
-#include <sys/mount.h>
+#include "config.h"
+#include "clibrary.h"
 #include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <time.h>
 
+/* Following portability code lifted from inndf.c */
+#if HAVE_STATVFS
+# include <sys/statvfs.h>
+# define df_stat(p, s)  (statvfs((p), (s)) == 0)
+# define df_declare(s)  struct statvfs s
+# define df_total(s)    ((s).f_blocks)
+# define df_avail(s)    ((s).f_bavail)
+# define df_scale(s)    ((s).f_frsize == 0 ? (s).f_bsize : (s).f_frsize)
+# define df_files(s)    ((s).f_files)
+# define df_favail(s)   ((s).f_favail)
+#elif HAVE_STATFS
+# if HAVE_SYS_VFS_H
+#  include <sys/vfs.h>
+# endif
+# if HAVE_SYS_PARAM_H
+#  include <sys/param.h>
+# endif
+# if HAVE_SYS_MOUNT_H
+#  include <sys/mount.h>
+# endif
+# ifdef __ultrix__
+#  define df_stat(p, s) (statfs((p), (s)) >= 1)
+#  define df_declare(s) struct fs_data s
+#  define df_total(s)   ((s).fd_btot)
+#  define df_avail(s)   ((s).fd_bfreen)
+#  define df_scale(s)   1024
+#  define df_files(s)   ((s).fd_gtot)
+#  define df_favail(s)  ((s).fd_gfree)
+# else
+#  define df_stat(p, s) (statfs((p), (s)) == 0)
+#  define df_declare(s) struct statfs s
+#  define df_total(s)   ((s).f_blocks)
+#  define df_avail(s)   ((s).f_bavail)
+#  define df_scale(s)   ((s).f_bsize)
+#  define df_files(s)   ((s).f_files)
+#  define df_favail(s)  ((s).f_ffree)
+# endif
+#else
+# error "Platform not supported.  Neither statvfs nor statfs available."
+#endif
+
 #define EXPIRE_CTL_DIR "/home/news"
 #define NEWS_SPOOL     "/home/news/spool/news/."
 
@@ -46,10 +84,10 @@
 #define EXPIRE_CTL     EXPIRE_CTL_DIR "/expire.ctl"
 #define EXPIRE_CTL_CTL EXPIRE_CTL_DIR "/expire.ctl.ctl"
 
-void
+int
 main(int ac, char **av)
 {
-    struct statfs sfs;
+    df_declare(sfs);
     long minFree = 100 * 1024 * 1024;
     long minIFree = 20 * 1024;
     long expireDays = 2;
@@ -104,7 +142,7 @@
        }
     }
 
-    if (statfs("/home/news/spool/news/.", &sfs) != 0) {
+    if (!df_stat("/home/news/spool/news/.", &sfs)) {
        fprintf(stderr, "expirectl: couldn't fsstat /home/news/spool/news/.\n");
        exit(1);
     }
@@ -139,8 +177,8 @@
 
     if (verbose) {
        printf("spool: %4.2lfM / %3.2lfKinode free\n",
-           (double)sfs.f_fsize * (double)sfs.f_bavail / (1024.0 * 1024.0),
-           (double)sfs.f_ffree / 1024.0
+           (double)df_scale(sfs) * (double)df_avail(sfs) / (1024.0 * 1024.0),
+           (double)df_favail(sfs) / 1024.0
        );
        printf("decrs: %4.2lfM / %3.2lfKinode\n",
            (double)(minFree) / (double)(1024*1024),
@@ -160,8 +198,8 @@
        double bytes;
        long inodes;
 
-       bytes = (double)sfs.f_fsize * (double)sfs.f_bavail;
-       inodes = sfs.f_ffree;
+       bytes = (double)df_scale(sfs) * (double)df_avail(sfs);
+       inodes = df_favail(sfs);
 
        if (bytes < (double)minFree || inodes < minIFree) {
            if (--expireDays <= 0) {
@@ -170,7 +208,7 @@
            }
            if (modified >= 0)
                modified = 1;
-           printf("decrement expiration to %d days\n", expireDays);
+           printf("decrement expiration to %ld days\n", expireDays);
        } else if (bytes >= (double)minFree * 2.0 && inodes >= minIFree * 2) {
            long dt = (long)(time(NULL) - expireIncTime);
 
@@ -179,12 +217,12 @@
                expireIncTime = time(NULL);
                if (modified >= 0)
                    modified = 1;
-               printf("increment expiration to %d days\n", expireDays);
+               printf("increment expiration to %ld days\n", expireDays);
            } else {
                printf("will increment expiration later\n");
            }
        } else if (verbose) {
-           printf("expiration unchanged: %d\n", expireDays);
+           printf("expiration unchanged: %ld\n", expireDays);
        }
     }
 
@@ -223,7 +261,7 @@
                                v = 1;
                            if (v < m)
                                v = m;
-                           sprintf(dptr, "%d", v);
+                           sprintf(dptr, "%ld", v);
                            dptr += strlen(dptr);
                            ++sptr;
                        }
@@ -254,7 +292,7 @@
 
        if ((fo = fopen(EXPIRE_DAYS, "w")) != NULL) {
            fprintf(fo, "time 0x%08lx\n", expireIncTime);
-           fprintf(fo, "days %d\n", expireDays);
+           fprintf(fo, "days %ld\n", expireDays);
            fclose(fo);
        } else {
            fprintf(stderr, "unable to create %s\n", EXPIRE_DAYS);



------------------------------

Message: 3
Date: Sun, 21 Sep 2014 05:41:40 -0700 (PDT)
From: INN Commit <r...@isc.org>
To: inn-committ...@isc.org
Subject: INN commit: branches/2.5 (4 files)
Message-ID: <20140921124140.b68db67...@hope.eyrie.org>

    Date: Sunday, September 21, 2014 @ 05:41:40
  Author: iulius
Revision: 9709

Fix a few warnings, and update svn:ignore for contrib

Modified:
  branches/2.5/contrib/ (properties)
  branches/2.5/contrib/mlockfile.c
  branches/2.5/contrib/newsresp.c
  branches/2.5/contrib/pullart.c

-------------+
 mlockfile.c |   10 +++--
 newsresp.c  |  109 ++++++++++++++++++++++++++++++++--------------------------
 pullart.c   |    8 +---
 3 files changed, 70 insertions(+), 57 deletions(-)


Property changes on: branches/2.5/contrib
___________________________________________________________________
Modified: svn:ignore
   - .libs
archivegz
backlogstat
cleannewsgroups
delayer
findreadgroups
makeexpctl
makestorconf
mlockfile
newsresp
pullart
reset-cnfs
respool
stathist
thdexpire
tunefeed

   + .libs
archivegz
auth_pass
backlogstat
cleannewsgroups
delayer
expirectl
findreadgroups
makeexpctl
makestorconf
mlockfile
newsresp
pullart
reset-cnfs
respool
stathist
thdexpire
tunefeed


Modified: contrib/mlockfile.c
===================================================================
--- contrib/mlockfile.c 2014-09-21 12:38:19 UTC (rev 9708)
+++ contrib/mlockfile.c 2014-09-21 12:41:40 UTC (rev 9709)
@@ -27,6 +27,8 @@
     size_t length;
 };
 
+void inn_lock_files(struct mlock *);
+
 char *progname;
 
 int flush = 0;
@@ -56,7 +58,7 @@
                     ml->st.st_size != st.st_size) {
                if (ml->base != MAP_FAILED)
                    munmap(ml->base,
-                          ml->length ? ml->length : ml->st.st_size);
+                          ml->length > 0 ? ml->length : (size_t) 
ml->st.st_size);
 
                /* free everything here, so in case of failure we try
                 * again next time */
@@ -65,7 +67,7 @@
                ml->st.st_size = 0;
 
                ml->base = mmap(NULL,
-                               ml->length ? ml->length : st.st_size,
+                               ml->length > 0 ? ml->length : (size_t) 
st.st_size,
                                PROT_READ,
                                MAP_SHARED, fd, ml->offset);
 
@@ -74,7 +76,7 @@
                            progname, ml->path, strerror(errno));
                } else {
                    if (mlock(ml->base,
-                             ml->length ? ml->length : st.st_size) != 0) {
+                             ml->length > 0 ? ml->length : (size_t) 
st.st_size) != 0) {
                        fprintf(stderr, "%s: can't mlock `%s' - %s\n",
                                progname, ml->path, strerror(errno));
                    } else {
@@ -82,7 +84,7 @@
                    }
                }
            } else if (flush) {
-               msync(ml->base, ml->length ? ml->length : st.st_size, MS_SYNC);
+               msync(ml->base, ml->length > 0 ? ml->length : (size_t) 
st.st_size, MS_SYNC);
            }
        }
        close (fd);

Modified: contrib/newsresp.c
===================================================================
--- contrib/newsresp.c  2014-09-21 12:38:19 UTC (rev 9708)
+++ contrib/newsresp.c  2014-09-21 12:41:40 UTC (rev 9709)
@@ -64,26 +64,34 @@
  *   0.1   0.0  <<< 205 . 
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
+#include "clibrary.h"
+#include "portable/socket.h"
+
 #include <errno.h>
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
 
 #define NNTPPORT 119
+
+void error(const char *);
+void fatal(const char *);
+void ierror(const char *, const char *);
+void ifatal(const char *, const char *);
+unsigned int do_time(unsigned int);
+void ptime(void);
+void massagebuff(int, char *);
+bool punt(int);
+
 struct sockaddr_in sock_in;
 int sock;
 char buf[1024];
 
-main(argc,argv)
-int argc;
-char *argv[];
+int
+main(int argc, char *argv[])
 {
   int errflg = 0, c;
-  extern char *optarg;
-  extern int optind;
+  bool status = true;
   struct hostent *host;
   unsigned long temp;
   unsigned numart = 1;
@@ -126,40 +134,46 @@
     sock_in.sin_port = htons(NNTPPORT);
     printf("---------------------------------\n%s is %s port %d\n",
               *whoP,inet_ntoa(sock_in.sin_addr),ntohs(sock_in.sin_port));
-    punt(numart);
+    status = punt(numart);
     close(sock);
   }
+  if (status) {
+      exit(0);
+  } else {
+      exit(1);
+  }
 }
 
-error(what)
-char *what;
+void
+error(const char *what)
 {
-  ptime(); fflush(stdout);
+  ptime();
+  fflush(stdout);
   perror(what);
 }
 
-fatal(what)
-char *what;
+void
+fatal(const char *what)
 {
   error(what);
   exit(2);
 }
 
-ierror(how,what)
-char *how, *what;
+void
+ierror(const char *how, const char *what)
 {
-  printf("Expected %s, bailing out.\n",how);
+  printf("Expected %s, received %s; bailing out.\n", how, what);
 }
 
-ifatal(how,what)
-char *how, *what;
+void
+ifatal(const char *how, const char *what)
 {
-  ierror(how,what);
+  ierror(how, what);
   exit(1);
 }
 
-unsigned do_time(start)
-unsigned start;
+unsigned int
+do_time(unsigned int start)
 {
   struct timeval now;
 
@@ -167,10 +181,10 @@
   return ( now.tv_sec*1000 + now.tv_usec/1000 - start );
 }
 
+unsigned int start, elapsed, diff;
 
-unsigned start, elapsed, diff;
-
-ptime()
+void
+ptime(void)
 {
   diff = elapsed;
   elapsed = do_time(start);
@@ -178,9 +192,8 @@
   printf("%5.1f %5.1f  ",((float)elapsed)/1000.0,((float)diff)/1000.0);
 }
 
-massagebuff(bread,buf)
-int bread;
-char *buf;
+void
+massagebuff(int bread, char *buf)
 {
   char *p;
 
@@ -197,8 +210,8 @@
     }
 }
 
-punt(numart)
-int numart;
+bool
+punt(int numart)
 {
   static char ihave[32],
              dot[] = ".\r\n",
@@ -215,42 +228,42 @@
   printf("Connecting ...\n");
   if ( connect(sock,(struct sockaddr*)&sock_in,sizeof(sock_in)) < 0 ) {
     error("connect");
-    return(-1);
+    return false;
   }
   ptime();
   printf("OK, waiting for prompt\n");
 
   if ( (bread=read(sock,buf,sizeof(buf))) < 0 ) {
     error("read socket");
-    return(-1);
+    return false;
   }
   massagebuff(bread,buf);
   ptime();
   printf("<<< %s",buf);
   if ( strncmp(buf,"200",3) != 0 && strncmp(buf,"201",3) != 0 ) {
     ierror("200 or 201",buf);
-    return(-1);
+    return false;
   }
 
   do {
     snprintf(ihave,sizeof(ihave),"ihave <%u@a>\r\n",start+numart);
     ptime();
     printf(">>> %s",ihave);
-    if ( write(sock,ihave,strlen(ihave)) != strlen(ihave) ) {
+    if ( write(sock,ihave,strlen(ihave)) != (int) strlen(ihave) ) {
       error("write socket");
-      return(-1);
+      return false;
     }
 
     if ( (bread=read(sock,buf,sizeof(buf))) < 0 ) {
       error("read socket");
-      return(-1);
+      return false;
     }
     massagebuff(bread,buf);
     ptime();
     printf("<<< %s",buf);
     if ( strncmp(buf,"335",3) != 0 && strncmp(buf,"435",3) != 0 ) {
-      ierror("335 or 435 ",buf);
-      return(-1);
+      ierror("335 or 435",buf);
+      return false;
     }
 
     if ( strncmp(buf,"335",3) == 0 ) {
@@ -258,19 +271,19 @@
       printf(">>> %s",dot);
       if ( write(sock,dot,sizeof(dot)-1) != sizeof(dot)-1 ) {
        error("write socket");
-       return(-1);
+       return false;
       }
 
       if ( (bread=read(sock,buf,sizeof(buf))) < 0 ) {
        error("read socket");
-       return(-1);
+       return false;
       }
       massagebuff(bread,buf);
       ptime();
       printf("<<< %s",buf);
       if ( strncmp(buf,"437",3) != 0 && strncmp(buf,"235",3) != 0 ) {
        ierror("437 or 235",buf);
-       return(-1);
+       return false;
       }
     }
   } while ( --numart != 0 );
@@ -279,19 +292,19 @@
   printf(">>> %s",quit);
   if ( write(sock,quit,sizeof(quit)-1) != sizeof(quit)-1 ) {
     error("write socket");
-    return(-1);
+    return false;
   }
 
   if ( (bread=read(sock,buf,sizeof(buf))) < 0 ) {
     error("read socket");
-    return(-1);
+    return false;
   }
   massagebuff(bread,buf);
   ptime();
   printf("<<< %s",buf);
   if ( strncmp(buf,"205",3) != 0 ) {
     ierror("205",buf);
-    return(-1);
+    return false;
   }
-  return(0);
+  return true;
 }

Modified: contrib/pullart.c
===================================================================
--- contrib/pullart.c   2014-09-21 12:38:19 UTC (rev 9708)
+++ contrib/pullart.c   2014-09-21 12:41:40 UTC (rev 9709)
@@ -17,9 +17,7 @@
 */
 
 #include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "clibrary.h"
 
 #define INFILE     1
 #define FILEPREFIX 2
@@ -195,7 +193,7 @@
 
                }
 
-       close (Infile);
+       fclose (Infile);
 
        return 0;
        }
@@ -290,7 +288,7 @@
        while (n--)
                fprintf (outfile, "%c", *buff++);
 
-       close (outfile);
+       fclose (outfile);
 
        /*  Return number of files written  */
        return 1;



------------------------------

Message: 4
Date: Sun, 21 Sep 2014 05:43:48 -0700 (PDT)
From: INN Commit <r...@isc.org>
To: inn-committ...@isc.org
Subject: INN commit: branches/2.5/contrib (reset-cnfs.c)
Message-ID: <20140921124349.02dcc67...@hope.eyrie.org>

    Date: Sunday, September 21, 2014 @ 05:43:48
  Author: iulius
Revision: 9710

Fix build of contrib/reset-cnfs.c

Add correct include header files.

Use the right DO_LARGEFILES variable instead of LARGE_FILES.

Reformat the code (remove tabulations).

Properly exit with the right status code.

Modified:
  branches/2.5/contrib/reset-cnfs.c

--------------+
 reset-cnfs.c |   84 +++++++++++++++++++++++++++++++--------------------------
 1 file changed, 47 insertions(+), 37 deletions(-)

Modified: reset-cnfs.c
===================================================================
--- reset-cnfs.c        2014-09-21 12:41:40 UTC (rev 9709)
+++ reset-cnfs.c        2014-09-21 12:43:48 UTC (rev 9710)
@@ -1,56 +1,66 @@
 /* Quick and Dirty Hack to reset a CNFS buffer without having to DD the
  * Entire Thing from /dev/zero again. */
-#include <sys/types.h>
-#include <sys/stat.h>
+#include "config.h"
+#include "clibrary.h"
+
 #include <errno.h>
 #include <fcntl.h>
+#include <sys/stat.h>
 
-#include <stdio.h>
 
-/* uncomment the below for LARGE_FILES support */ 
-/* #define LARGE_FILES */
-
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
 {
     int fd;
     int i, j;
     char buf[512];
-#ifdef LARGE_FILES 
-    struct stat64 st; 
-#else 
-    struct stat st; 
+#ifdef DO_LARGEFILES
+    struct stat64 st;
+#else
+    struct stat st;
 #endif
     int numwr;
+    bool status = true;
 
     bzero(buf, sizeof(buf));
     for (i = 1; i < argc; i++) {
-#ifdef LARGE_FILES 
-       if ((fd = open(argv[i], O_LARGEFILE | O_RDWR, 0664)) < 0) 
-#else 
-       if ((fd = open(argv[i], O_RDWR, 0664)) < 0) 
+#ifdef DO_LARGEFILES
+        if ((fd = open(argv[i], O_LARGEFILE | O_RDWR, 0664)) < 0) {
+#else
+        if ((fd = open(argv[i], O_RDWR, 0664)) < 0) {
 #endif
-           fprintf(stderr, "Could not open file %s: %s\n", argv[i], 
strerror(errno));
-       else {
-#ifdef LARGE_FILES 
-           if (fstat64(fd, &st) < 0) { 
-#else 
-           if (fstat(fd, &st) < 0) { 
+            fprintf(stderr, "Could not open file %s: %s\n", argv[i], 
strerror(errno));
+            status = false;
+        } else {
+#ifdef DO_LARGEFILES
+            if (fstat64(fd, &st) < 0) {
+#else
+            if (fstat(fd, &st) < 0) {
 #endif
-               fprintf(stderr, "Could not stat file %s: %s\n", argv[i], 
strerror(errno));
-           } else {
-               /* each bit in the bitfield is 512 bytes of data.  Each byte
-                * has 8 bits, so calculate as 512 * 8 bytes of data, plus
-                * fuzz. buf has 512 bytes in it, therefore containing data for
-                * (512 * 8) * 512 bytes of data. */
-               numwr = (st.st_size / (512*8) / sizeof(buf)) + 50;
-               printf("File %s: %u %u\n", argv[i], st.st_size, numwr);
-               for (j = 0; j < numwr; j++) {
-                   if (!(j % 100))
-                       printf("\t%d/%d\n", j, numwr);
-                   write(fd, buf, sizeof(buf));
-               }
-           }
-           close(fd);
-       }
+                fprintf(stderr, "Could not stat file %s: %s\n", argv[i], 
strerror(errno));
+                status = false;
+            } else {
+                /* Each bit in the bitfield is 512 bytes of data.  Each byte
+                 * has 8 bits, so calculate as 512 * 8 bytes of data, plus
+                 * fuzz.  buf has 512 bytes in it, therefore containing data
+                 * for (512 * 8) * 512 bytes of data. */
+                numwr = (st.st_size / (512*8) / sizeof(buf)) + 50;
+                printf("File %s: %lu %u\n", argv[i], st.st_size, numwr);
+                for (j = 0; j < numwr; j++) {
+                    if (!(j % 100)) {
+                        printf("\t%d/%d\n", j, numwr);
+                    }
+                    write(fd, buf, sizeof(buf));
+                }
+            }
+            close(fd);
+            status = true;
+        }
     }
+
+    if (status) {
+        exit(0);
+    } else {
+        exit(1);
+    }
 }



------------------------------

Message: 5
Date: Sun, 21 Sep 2014 05:44:27 -0700 (PDT)
From: INN Commit <r...@isc.org>
To: inn-committ...@isc.org
Subject: INN commit: branches/2.5/contrib (Makefile respool.c)
Message-ID: <20140921124427.8e7d767...@hope.eyrie.org>

    Date: Sunday, September 21, 2014 @ 05:44:27
  Author: iulius
Revision: 9711

Fix build of contrib/respool.c

Remove an unused variable.

Add a link to libhistory.

Modified:
  branches/2.5/contrib/Makefile
  branches/2.5/contrib/respool.c

-----------+
 Makefile  |    2 +-
 respool.c |    2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

Modified: Makefile
===================================================================
--- Makefile    2014-09-21 12:43:48 UTC (rev 9710)
+++ Makefile    2014-09-21 12:44:27 UTC (rev 9711)
@@ -34,7 +34,7 @@
 LINK           = $(LIBLD) $(LDFLAGS) -o $@
 FIX            = $(FIXSCRIPT)
 
-STORELIBS      = $(LIBSTORAGE) $(LIBINN) $(STORAGE_LIBS) $(LIBS)
+STORELIBS      = $(LIBSTORAGE) $(LIBHIST) $(LIBINN) $(STORAGE_LIBS) $(LIBS)
 
 auth_pass:     auth_pass.o     ; $(LINK) auth_pass.o $(LIBINN) $(CRYPT_LIBS)
 expirectl:     expirectl.o     ; $(LINK) expirectl.o

Modified: respool.c
===================================================================
--- respool.c   2014-09-21 12:43:48 UTC (rev 9710)
+++ respool.c   2014-09-21 12:44:27 UTC (rev 9711)
@@ -29,7 +29,6 @@
     ARTHANDLE newart;
     TOKEN token, newtoken;
     char *arttmp;
-    time_t arrived;
 
     tokenptr = line;
     
@@ -47,7 +46,6 @@
     if ((art = SMretrieve(token, RETR_ALL)) == NULL) return;
 
     len = art->len;
-    arrived = art->arrived;
     arttmp = xmalloc(len);
     memcpy(arttmp, art->data, len);
     SMfreearticle(art);



------------------------------

Message: 6
Date: Sun, 21 Sep 2014 05:54:40 -0700 (PDT)
From: INN Commit <r...@isc.org>
To: inn-committ...@isc.org
Subject: INN commit: trunk (Makefile)
Message-ID: <20140921125440.e120a67...@hope.eyrie.org>

    Date: Sunday, September 21, 2014 @ 05:54:40
  Author: iulius
Revision: 9712

Clean the contrib directory along with the other directories

Modified:
  trunk/Makefile

----------+
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Modified: Makefile
===================================================================
--- Makefile    2014-09-21 12:44:27 UTC (rev 9711)
+++ Makefile    2014-09-21 12:54:40 UTC (rev 9712)
@@ -22,7 +22,7 @@
               scripts
 UPDATEDIRS  = $(LIBDIRS) $(PROGDIRS) doc
 ALLDIRS     = $(UPDATEDIRS) samples site
-CLEANDIRS   = $(ALLDIRS) tests
+CLEANDIRS   = $(ALLDIRS) contrib tests
 
 ##  The directory name and tar file to use when building a release.
 TARDIR      = inn-$(VERSION)$(RELEASENUMBER)



------------------------------

_______________________________________________
inn-committers mailing list
inn-committers@lists.isc.org
https://lists.isc.org/mailman/listinfo/inn-committers

End of inn-committers Digest, Vol 67, Issue 15
**********************************************

Reply via email to