Hello community,

here is the log from the commit of package mbuffer for openSUSE:Factory checked 
in at 2012-11-26 18:59:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mbuffer (Old)
 and      /work/SRC/openSUSE:Factory/.mbuffer.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mbuffer", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/mbuffer/mbuffer.changes  2012-05-22 
08:16:47.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.mbuffer.new/mbuffer.changes     2012-11-26 
18:59:49.000000000 +0100
@@ -1,0 +2,8 @@
+Sat Nov 17 14:09:22 UTC 2012 - [email protected]
+
+- update to 20121111:
+  * support float values as argument to memory options
+  * added a watchdog that terminates mbuffer if input
+    or output activity stalls (option -W)
+
+-------------------------------------------------------------------

Old:
----
  mbuffer-20120505.tgz

New:
----
  mbuffer-20121111.tgz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mbuffer.spec ++++++
--- /var/tmp/diff_new_pack.Gd7o8x/_old  2012-11-26 18:59:51.000000000 +0100
+++ /var/tmp/diff_new_pack.Gd7o8x/_new  2012-11-26 18:59:51.000000000 +0100
@@ -14,7 +14,7 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 
 Name:           mbuffer
-Version:        20120505
+Version:        20121111
 Release:        0
 Summary:        Replacement for "buffer" with many more Features
 Source:         
http://www.maier-komor.de/software/mbuffer/mbuffer-%{version}.tgz

++++++ mbuffer-20120505.tgz -> mbuffer-20121111.tgz ++++++
++++ 1846 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mbuffer-20120505/.hg_archival.txt new/mbuffer-20121111/.hg_archival.txt
--- old/mbuffer-20120505/.hg_archival.txt       2012-05-05 12:56:43.000000000 
+0200
+++ new/mbuffer-20121111/.hg_archival.txt       2012-11-16 11:17:11.000000000 
+0100
@@ -1,5 +1,5 @@
 repo: 6e3b485d74645931e2408ed1f57e659029b5639a
-node: 3a6f39dad474646a556396cfe8ada60f18029a13
+node: 4a89ab956ab1590b4b3b7be2343e6d2eedc29e5b
 branch: default
-latesttag: 20120505
+latesttag: 20121111
 latesttagdistance: 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mbuffer-20120505/.hgtags new/mbuffer-20121111/.hgtags
--- old/mbuffer-20120505/.hgtags        2012-05-05 12:56:43.000000000 +0200
+++ new/mbuffer-20121111/.hgtags        2012-11-16 11:17:11.000000000 +0100
@@ -78,3 +78,4 @@
 4640c8887046b429b67d5f0d1d4fc9f80104d8d1 20110317
 2b559c9d44c3ecab08b7c17a79358668e300e8de 20110724
 1dd2c4da5bc9b4a206088bba779e5ade04ba38fe 20120505
+68aef5382cb71cd986b7fead24efe0d6f6a90396 20121111
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mbuffer-20120505/ChangeLog new/mbuffer-20121111/ChangeLog
--- old/mbuffer-20120505/ChangeLog      2012-05-05 12:56:43.000000000 +0200
+++ new/mbuffer-20121111/ChangeLog      2012-11-16 11:17:11.000000000 +0100
@@ -1,3 +1,10 @@
+20121111:
+- build fix for some platforms
+- several minor code cleanups (removed some warnings)
+- support float values as argument to memory options
+- added a watchdog that terminates mbuffer if input
+  or output activity stalls (option -W)
+
 20120505:
 - fixed IPv6 client initialization on FreeBSD
 - fix: suppress summary on stderr if -q is used with -l
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mbuffer-20120505/configure.in new/mbuffer-20121111/configure.in
--- old/mbuffer-20120505/configure.in   2012-05-05 12:56:43.000000000 +0200
+++ new/mbuffer-20121111/configure.in   2012-11-16 11:17:11.000000000 +0100
@@ -5,7 +5,7 @@
 AC_EXEEXT
 
 PACKAGE=mbuffer
-VERSION=20120505
+VERSION=20121111
 
 if test "${LD_LIBRARY_PATH}" != "" ; then
        echo ""
@@ -26,6 +26,7 @@
 USRCFLAGS=${CFLAGS}
 
 AC_LANG_C
+AC_PROG_CC_C99
 AC_PROG_CC(cc gcc)
 AC_C_RESTRICT
 AC_C_INLINE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mbuffer-20120505/log.h new/mbuffer-20121111/log.h
--- old/mbuffer-20120505/log.h  2012-05-05 12:56:43.000000000 +0200
+++ new/mbuffer-20121111/log.h  2012-11-16 11:17:11.000000000 +0100
@@ -37,6 +37,9 @@
 void logdebug(const char *msg, ...);
 #define debugmsg if (Verbose >= 5) logdebug
 #define debugiomsg if (Verbose >= 6) logdebug
+#elif __STDC_VERSION__ >= 199901L
+#define debugmsg(...)
+#define debugiomsg(...)
 #else
 #define debugmsg
 #define debugiomsg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mbuffer-20120505/mbuffer.1.in new/mbuffer-20121111/mbuffer.1.in
--- old/mbuffer-20120505/mbuffer.1.in   2012-05-05 12:56:43.000000000 +0200
+++ new/mbuffer-20121111/mbuffer.1.in   2012-11-16 11:17:11.000000000 +0100
@@ -151,6 +151,14 @@
 .TP 
 \fB\-V, \-\-version\fR
 Output version information and exit.
+.TP 
+\fB\-W\fR <\fItimeout\fP>
+Activates a watchdog that gets triggered every \fItimeout\fP seconds and
+checks weather I/O activity has stalled. If either channel has stalled
+for a complete period, the watchdog writes an error message and
+terminates mbuffer via SIGINT. Be aware that the watchdog is unaware of
+tape-change activities. So choose the watchdog timeout greater that the
+worst-case tape-change time.
 .SH "ENVIRONMENT VARIABLES"
 If TMPDIR is set, mbuffer allocates storage for file-based buffers in this
 directory\&. If TMPDIR is unset, \fI/var/tmp\fR will be used\&.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/mbuffer-20120505/mbuffer.c new/mbuffer-20121111/mbuffer.c
--- old/mbuffer-20120505/mbuffer.c      2012-05-05 12:56:43.000000000 +0200
+++ new/mbuffer-20121111/mbuffer.c      2012-11-16 11:17:11.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2000-2011, Thomas Maier-Komor
+ *  Copyright (C) 2000-2012, Thomas Maier-Komor
  *
  *  This is the source code of mbuffer.
  *
@@ -30,6 +30,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <float.h>
 #include <libgen.h>
 #include <limits.h>
 #include <math.h>
@@ -129,10 +130,10 @@
        PrefixLen = 0;
 
 static pthread_t
-       Reader;
+       Reader, Watchdog;
 static long
        Tmp = -1, Pause = 0, Memmap = 0,
-       Status = 1, Append = O_CREAT, Nooverwrite = O_EXCL, Outblocksize = 0,
+       Status = 1, Nooverwrite = O_EXCL, Outblocksize = 0,
        Autoload_time = 0, OptSync = 0;
 static unsigned long
        Outsize = 10240;
@@ -344,6 +345,29 @@
 
 
 
+static void *watchdogThread(void *timeout)
+{
+       unsigned long ni = Numin, no = Numout;
+       unsigned t = (unsigned) timeout;
+       for (;;) {
+               sleep(t);
+               if ((ni == Numin) && (Finish == -1)) {
+                       errormsg("watchdog timeout: input stalled; sending 
SIGINT\n");
+                       kill(getpid(),SIGINT);
+               }
+               if (no == Numout) {
+                       errormsg("watchdog timeout: output stalled; sending 
SIGINT\n");
+                       kill(getpid(),SIGINT);
+               }
+               ni = Numin;
+               no = Numout;
+       }
+#ifdef __GNUC__
+       return 0;       // suppresses a gcc warning
+#endif
+}
+
+
 static void statusThread(void) 
 {
        struct timeval last, now;
@@ -817,7 +841,7 @@
                        errormsg("error closing file %s: 
%s\n",d->arg,strerror(errno));
        }
        if (ret != 0) {
-               int ret = syncSenders(0,-1);
+               ret = syncSenders(0,-1);
                debugmsg("terminateSender(%s): sendSender(0,-1) = 
%d\n",d->arg,ret);
        }
        pthread_exit((void *) ret);
@@ -1408,51 +1432,51 @@
                "Unsupported buffer options: -t -Z -B\n"
                ,Numblocks
                ,Blocksize
-               ,m,*dim
+               ,m
+               ,*dim
                );
        exit(EXIT_SUCCESS);
 }
 
 
-
-static unsigned long long calcint(const char **argv, int c, unsigned long long 
d)
+static unsigned long long calcint(const char **argv, int c, unsigned long long 
def)
 {
        char ch;
-       unsigned long long i;
+       double d = (double)def;
        
-       switch (sscanf(argv[c],"%llu%c",&i,&ch)) {
+       switch (sscanf(argv[c],"%lf%c",&d,&ch)) {
        default:
                assert(0);
                break;
        case 2:
-               if (i == 0)
+               if (d <= 0)
                        fatal("invalid argument - must be > 0\n");
                switch (ch) {
                case 'k':
                case 'K':
-                       i <<= 10;
-                       return i;
+                       d *= 1024.0;
+                       return (unsigned long long) d;
                case 'm':
                case 'M':
-                       i <<= 20;
-                       return i;
+                       d *= 1024.0*1024.0;
+                       return (unsigned long long) d;
                case 'g':
                case 'G':
-                       i <<= 30;
-                       return i;
+                       d *= 1024.0*1024.0*1024.0;
+                       return (unsigned long long) d;
                case 't':
                case 'T':
-                       i <<= 40;
-                       return i;
+                       d *= 1024.0*1024.0*1024.0*1024.0;
+                       return (unsigned long long) d;
                case '%':
-                       if (i >= 100)
-                               fatal("invalid value for percentage (must be < 
100)\n");
-                       return i;
+                       if ((d >= 90) || (d <= 0))
+                               fatal("invalid value for percentage (must be 
0..90)\n");
+                       return (unsigned long long) d;
                case 'b':
                case 'B':
-                       if (i < 128)
+                       if (d < 128)
                                fatal("invalid value for number of bytes\n");
-                       return i;
+                       return (unsigned long long) d;
                default:
                        if (argv[c][-2] == '-')
                                fatal("unrecognized size charakter \"%c\" for 
option \"%s\"\n",ch,&argv[c][-2]);
@@ -1461,13 +1485,15 @@
                        return d;
                }
        case 1:
-               if (i <= 100) {
+               if (d <= 0)
+                       fatal("invalid argument - must be > 0\n");
+               if (d <= 100) {
                        if (argv[c][-2] == '-')
                                fatal("invalid low value for option \"%s\" - 
missing suffix?\n",&argv[c][-2]);
                        else
                                fatal("invalid low value for option \"%s\" - 
missing suffix?\n",argv[c-1]);
                }
-               return i;
+               return d;
        case 0:
                break;
        }
@@ -1572,7 +1598,7 @@
        unsigned long long totalmem = 0;
        int optMset = 0, optSset = 0, optBset = 0, optMode = O_EXCL, numOut = 0;
        int  numstdout = 0, numthreads = 0;
-       long mxnrsem;
+       long mxnrsem, timeout = 0;
        int c, fl, err;
        sigset_t       signalSet;
 #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
@@ -1585,7 +1611,7 @@
        struct sigaction sig;
        dest_t *dest = 0;
 #if defined(_SC_AVPHYS_PAGES) && defined(_SC_PAGESIZE) && !defined(__CYGWIN__)
-       long pgsz, nump;
+       long long pgsz, nump;
 
        TickTime = 1000000 / sysconf(_SC_CLK_TCK);
        pgsz = sysconf(_SC_PAGESIZE);
@@ -1709,7 +1735,7 @@
                                dest->mode = 
O_CREAT|O_WRONLY|optMode|Direct|LARGEFILE|OptSync;
                        } else {
                                if (numstdout++) 
-                                       fatal("cannot output multiple times to 
stdout");
+                                       fatal("cannot output multiple times to 
stdout\n");
                                debugmsg("output to stdout\n",argv[c]);
                                dest->fd = dup(STDOUT_FILENO);
                                err = dup2(STDERR_FILENO,STDOUT_FILENO);
@@ -1785,6 +1811,8 @@
                                Autoloader = 1;
                                Autoload_time = at;
                        }
+                       if (at && timeout && timeout <= Autoload_time)
+                               fatal("autoload time must be smaller than 
watchdog timeout\n");
                        debugmsg("Autoloader time = %d\n",Autoload_time);
                } else if (!argcheck("-A",argv,&c,argc)) {
                        Autoloader = 1;
@@ -1795,7 +1823,7 @@
                                StartWrite = 0;
                        StartWrite /= 100;
                        if ((StartWrite > 1) || (StartWrite <= 0))
-                               fatal("error in argument -P: must be bigger 
than 0 and less or equal 100");
+                               fatal("error in argument -P: must be bigger 
than 0 and less or equal 100\n");
                        debugmsg("StartWrite = %1.2lf\n",StartWrite);
                } else if (!argcheck("-p",argv,&c,argc)) {
                        if (1 == sscanf(argv[c],"%lf",&StartRead))
@@ -1803,7 +1831,7 @@
                        else
                                StartRead = 1.0;
                        if ((StartRead >= 1) || (StartRead < 0))
-                               fatal("error in argument -p: must be bigger or 
equal to 0 and less than 100");
+                               fatal("error in argument -p: must be bigger or 
equal to 0 and less than 100\n");
                        debugmsg("StartRead = %1.2lf\n",StartRead);
                } else if (!strcmp("-L",argv[c])) {
 #ifdef _POSIX_MEMLOCK_RANGE
@@ -1812,6 +1840,12 @@
 #else
                        warning("POSIX memory locking is unsupported on this 
system.\n");
 #endif
+               } else if (!argcheck("-W",argv,&c,argc)) {
+                       timeout = strtol(argv[c],0,0);
+                       if (timeout <= 0)
+                               fatal("invalid argument to option -W\n");
+                       if (timeout <= Autoload_time)
+                               fatal("timeout must be bigger than autoload 
time\n");
                } else if (!strcmp("--direct",argv[c])) {
 #ifdef O_DIRECT
                        debugmsg("using O_DIRECT to open file descriptors\n");
@@ -1864,7 +1898,7 @@
        if (optBset&optSset&optMset) {
                if (Numblocks * Blocksize != totalmem)
                        fatal("inconsistent options: blocksize * number of 
blocks != totalsize!\n");
-       } else if ((!optBset&optSset&optMset) || (optMset&!optBset&!optSset)) {
+       } else if (((!optBset)&optSset&optMset) || 
(optMset&(!optBset)&(!optSset))) {
                if (totalmem <= Blocksize)
                        fatal("total memory must be larger than block size\n");
                Numblocks = totalmem / Blocksize;
@@ -2153,6 +2187,10 @@
        }
        err = pthread_create(&dest->thread,0,&outputThread,dest);
        assert(0 == err);
+       if (timeout) {
+               err = 
pthread_create(&Watchdog,0,&watchdogThread,(void*)timeout);
+               assert(0 == err);
+       }
        if (Status) {
                err = pthread_create(&Reader,0,&inputThread,0);
                assert(0 == err);
@@ -2170,6 +2208,10 @@
                        assert(err == 1);
                }
        }
+       if (timeout) {
+               err = pthread_cancel(Watchdog);
+               assert(err == 0);
+       }
        if (Dest) {
                dest_t *d = Dest;
                int ret;

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to