[csw-devel] SF.net SVN: gar:[3608] csw/mgar/pkg/watch/trunk

skayser at users.sourceforge.net skayser at users.sourceforge.net
Sat Mar 7 01:49:10 CET 2009


Revision: 3608
          http://gar.svn.sourceforge.net/gar/?rev=3608&view=rev
Author:   skayser
Date:     2009-03-07 00:49:09 +0000 (Sat, 07 Mar 2009)

Log Message:
-----------
watch: fixed broken pipe errors

Modified Paths:
--------------
    csw/mgar/pkg/watch/trunk/Makefile
    csw/mgar/pkg/watch/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/watch/trunk/files/patch-sigpipe.diff

Modified: csw/mgar/pkg/watch/trunk/Makefile
===================================================================
--- csw/mgar/pkg/watch/trunk/Makefile	2009-03-06 16:56:03 UTC (rev 3607)
+++ csw/mgar/pkg/watch/trunk/Makefile	2009-03-07 00:49:09 UTC (rev 3608)
@@ -1,13 +1,9 @@
-# Todo:
-# * watch called for programs with longer than terminal output 
-#   (for example "find ." or "ls -lR" or "last" on build8x) causes
-#   broken pipe on second program invocation
 GARNAME = watch
 GARVERSION = 3.2.7
 CATEGORIES = utils
 
 DESCRIPTION = Watch a program output change over time
-define Blurb
+define BLURB
   "watch" from the procps package.
 endef
 
@@ -16,20 +12,25 @@
 SF_PROJ 	= procps
 MASTER_SITES 	= http://$(SF_PROJ).sourceforge.net/
 DISTFILES  	= $(SF_PROJ)-$(GARVERSION).tar.gz
-PATCHFILES	= patch-extralibs.diff
 DISTNAME   	= $(SF_PROJ)-$(GARVERSION)
 
 REQUIRED_PKGS = CSWncurses
 
-CONFIGURE_ARGS = $(DIRPATHS)
-
-EXTRA_INC = /opt/csw/include/ncurses
-
 TEST_SCRIPTS =
 CONFIGURE_SCRIPTS =
 BUILD_SCRIPTS = custom
 INSTALL_SCRIPTS = custom
 
+# Include additional libraries (see pre-build-modulated below)
+PATCHFILES = patch-extralibs.diff
+
+# Avoid "Broken pipe" error message on pclose() for cmds with longish output
+PATCHFILES += patch-sigpipe.diff
+
+CONFIGURE_ARGS = $(DIRPATHS)
+
+EXTRA_INC = /opt/csw/include/ncurses
+
 include gar/category.mk
 
 # procps is heavily GNU tailored, so we need to make some adjustments

Modified: csw/mgar/pkg/watch/trunk/checksums
===================================================================
--- csw/mgar/pkg/watch/trunk/checksums	2009-03-06 16:56:03 UTC (rev 3607)
+++ csw/mgar/pkg/watch/trunk/checksums	2009-03-07 00:49:09 UTC (rev 3608)
@@ -1,2 +1,3 @@
 f490bca772b16472962c7b9f23b1e97d  download/procps-3.2.7.tar.gz
 05f5e9e304c4300b056ffd61eafebffa  download/patch-extralibs.diff
+c29461ef280f8a7dca7ef1d5aeec8e2d  download/patch-sigpipe.diff

Added: csw/mgar/pkg/watch/trunk/files/patch-sigpipe.diff
===================================================================
--- csw/mgar/pkg/watch/trunk/files/patch-sigpipe.diff	                        (rev 0)
+++ csw/mgar/pkg/watch/trunk/files/patch-sigpipe.diff	2009-03-07 00:49:09 UTC (rev 3608)
@@ -0,0 +1,13 @@
+--- procps-3.2.7.orig/watch.c	2009-03-07 01:23:35.904690072 +0100
++++ procps-3.2.7/watch.c	2009-03-07 01:30:41.534474183 +0100
+@@ -313,6 +314,10 @@
+ 			oldeolseen = eolseen;
+ 		}
+ 
++		/* Finish reading from pipe to avoid SIGPIPE for the child */
++		char devnull[8192];
++		while (fgets(devnull, 8192, p) != NULL) {;}
++
+ 		pclose(p);
+ 
+ 		first_screen = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list