[fetchlog/el6] added patches
Paul Wouters
pwouters at fedoraproject.org
Wed Jul 4 02:23:47 UTC 2012
commit c6228fec0c803d0207fc3f4c22efed8c2d6c05e1
Author: Paul Wouters <paul at nohats.ca>
Date: Tue Jul 3 22:23:40 2012 -0400
added patches
fetchlog-1.4-tests.patch | 21 +++++++++++++++++++
fetchlog-1.4-write.patch | 43 ++++++++++++++++++++++++++++++++++++++
fetchlog-build.patch | 4 +-
fetchlog-unusedvar.patch | 51 ++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 117 insertions(+), 2 deletions(-)
---
diff --git a/fetchlog-1.4-tests.patch b/fetchlog-1.4-tests.patch
new file mode 100644
index 0000000..ad9c3c1
--- /dev/null
+++ b/fetchlog-1.4-tests.patch
@@ -0,0 +1,21 @@
+diff -Naur fetchlog-1.4-orig/test-all fetchlog-1.4/test-all
+--- fetchlog-1.4-orig/test-all 2010-07-02 06:10:08.000000000 -0400
++++ fetchlog-1.4/test-all 2012-07-03 21:02:55.213650680 -0400
+@@ -220,7 +220,7 @@
+
+ expect "param column range 3" \
+ 3 \
+- "ERROR: fetchlog: out of range: firstcol, lastco~" \
++ "ERROR: fetchlog: out of range: firstcol, lastco~ or len" \
+ ./fetchlog -f 1:50:49: ${logfile} ${bm}
+
+ expect "param column range 3 ok" \
+@@ -1061,7 +1061,7 @@
+
+ expect "fetching fetchlen errormsg 1" \
+ 3 \
+- "ERROR: fetchlog: out of range: firstcol, lastcol~" \
++ "ERROR: fetchlog: out of range: firstcol, lastcol~ r len" \
+ ./fetchlog -f 1:999:50: ${logfile} ${bm}
+
+ expect "fetching fetchlen 1" \
diff --git a/fetchlog-1.4-write.patch b/fetchlog-1.4-write.patch
new file mode 100644
index 0000000..9224850
--- /dev/null
+++ b/fetchlog-1.4-write.patch
@@ -0,0 +1,43 @@
+--- fetchlog.c-old 2012-04-05 14:48:22.999438037 -0400
++++ fetchlog.c 2012-04-05 14:52:56.469292696 -0400
+@@ -55,7 +55,7 @@
+ #define MIN_FETCHLEN 50 /* Min length of fetched data */
+ #define MAX_FETCHLEN 20000 /* Max length of fetched data */
+
+-#define OK_MESSAGE "OK: no messages"
++#define OK_MESSAGE "OK: no messages\n"
+ #define ERR_MESSAGE "ERROR: fetchlog: "
+
+ /* suffix for temp bookmarkfile: mkstemp() template */
+@@ -155,7 +155,7 @@
+ msg[fetchlen_G-2] = '~';
+ len = fetchlen_G + 1;
+ }
+- (void)write( STDOUT_FILENO, msg, len-1 );
++ fprintf(stdout, msg);
+ free( msg );
+ }
+
+@@ -295,7 +295,7 @@
+ /* something changed meanwhile ? */
+ if( obm.mtime==nbm.mtime && obm.inode==nbm.inode && obm.last==nbm.last ) {
+ if( conv_G & CONV_OKMSG )
+- (void)write( STDOUT_FILENO, OK_MESSAGE "\n", sizeof( OK_MESSAGE ));
++ fprintf(stdout, OK_MESSAGE "\n");
+ close( fd );
+ return RET_OK;
+ }
+@@ -484,11 +484,11 @@
+ ((conv_G & CONV_NAGIOS3)!= 0 && fetchlen_G-opos==4 ) ) ) ) {
+
+ if( conv_G & CONV_OKMSG ) {
+- (void)write( STDOUT_FILENO, OK_MESSAGE "\n", sizeof( OK_MESSAGE ) );
++ fprintf(stdout,OK_MESSAGE);
+ }
+ i = RET_OK;
+ }else{
+- (void)write( STDOUT_FILENO, obuf+opos,fetchlen_G-opos);
++ fprintf(stdout, "%s",obuf+opos);
+ i = RET_NEWMSG;
+ }
+
diff --git a/fetchlog-build.patch b/fetchlog-build.patch
index 42f0afb..6be3570 100644
--- a/fetchlog-build.patch
+++ b/fetchlog-build.patch
@@ -4,8 +4,8 @@
### gcc
CC=gcc
--CFLAGS= -O -Wall -Wcast-qual -Wstrict-prototypes \
-+CFLAGS= $(RPM_OPT_FLAGS) -Wall -Wcast-qual -Wstrict-prototypes \
+-CFLAGS= -O -Werror -Wall -Wcast-qual -Wstrict-prototypes \
++CFLAGS= $(RPM_OPT_FLAGS) -Wall -Wcast-qual -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations -Winline -Wcast-align
### cc
#CC=cc
diff --git a/fetchlog-unusedvar.patch b/fetchlog-unusedvar.patch
new file mode 100644
index 0000000..82712b3
--- /dev/null
+++ b/fetchlog-unusedvar.patch
@@ -0,0 +1,51 @@
+--- fetchlog-1.4/fetchlog.c 2010-07-02 06:10:08.000000000 -0400
++++ fetchlog-1.4/fetchlog.c.new 2011-12-18 16:00:13.108131721 -0500
+@@ -129,7 +129,6 @@
+ void perr( char *msg1, char *msg2, int err ) {
+ char *msg = NULL;
+ int len = 0;
+- int r;
+
+ if( !msg1 ) return;
+
+@@ -156,7 +155,7 @@
+ msg[fetchlen_G-2] = '~';
+ len = fetchlen_G + 1;
+ }
+- r = write( STDOUT_FILENO, msg, len-1 );
++ (void)write( STDOUT_FILENO, msg, len-1 );
+ free( msg );
+ }
+
+@@ -270,8 +269,6 @@
+ int lastlinepos = 0; /* pos of beginning of lastline in obuf */
+ int lastlinelen = 0; /* len of lastline, excl. trailing '\' 'n' */
+
+- int r; /* write's returncode */
+-
+ int i;
+ int fd = -1;
+ struct stat sb;
+@@ -298,7 +295,7 @@
+ /* something changed meanwhile ? */
+ if( obm.mtime==nbm.mtime && obm.inode==nbm.inode && obm.last==nbm.last ) {
+ if( conv_G & CONV_OKMSG )
+- r = write( STDOUT_FILENO, OK_MESSAGE "\n", sizeof( OK_MESSAGE ) );
++ (void)write( STDOUT_FILENO, OK_MESSAGE "\n", sizeof( OK_MESSAGE ));
+ close( fd );
+ return RET_OK;
+ }
+@@ -487,11 +484,11 @@
+ ((conv_G & CONV_NAGIOS3)!= 0 && fetchlen_G-opos==4 ) ) ) ) {
+
+ if( conv_G & CONV_OKMSG ) {
+- r = write( STDOUT_FILENO, OK_MESSAGE "\n", sizeof( OK_MESSAGE ) );
++ (void)write( STDOUT_FILENO, OK_MESSAGE "\n", sizeof( OK_MESSAGE ) );
+ }
+ i = RET_OK;
+ }else{
+- r = write( STDOUT_FILENO, obuf+opos,fetchlen_G-opos);
++ (void)write( STDOUT_FILENO, obuf+opos,fetchlen_G-opos);
+ i = RET_NEWMSG;
+ }
+
More information about the scm-commits
mailing list