From d55db645b8f93b8f7f8c0cf92afcfef65454c020 Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 23 Apr 2017 18:17:26 +0000 Subject: Release 10.78.03 git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2965 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- doc/HISTORY | 17 +++++++++++++++++ lib/Makefile | 13 ++++++++----- lib/libsystem.c | 24 ++++++++++++++++++------ lib/libsystem_dummy.c | 16 ++++++++++++++-- version.mk | 2 +- 5 files changed, 58 insertions(+), 14 deletions(-) diff --git a/doc/HISTORY b/doc/HISTORY index 707256a6..541e5f2b 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,23 @@ Netpbm. CHANGE HISTORY -------------- +17.04.23 BJH Release 10.78.03 + + libnetpbm: fix bug: pm_system_XXX closes Standard Input if you + supply a Standard Output accepter but not a Standard Input + feeder. Broken since Netpbm 10.40 (September 2007). + + Windows: fix bug: pm_system_lp() and pm_system_vp() fail + silently instead of with a clear error message in an environment + that does not provide Unix process management. Always broken. + (pm_system_lp and pm_system_vp were new in Netpbm 10.40 + (September 2007), but wouldn't even compile until Netpbm 10.42 + (March 2008)). + + Build: don't try to build standardppmdfont.c if it already + exists (so don't require ppmdcfont to exist). Broken around + Netpbm 10.35 (2006). + 17.04.15 BJH Release 10.78.02 pamcomp: fix incorrect output with -mixtransparency. diff --git a/lib/Makefile b/lib/Makefile index 7af07803..a0f33745 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -191,11 +191,14 @@ libnetpbm.$(STATICLIBSUFFIX): $(LIBOBJECTS) $(LIBOBJECTS_X) endif -# To avoid major hassles with having ppmdcfont available here, we just -# ship a pre-made standardppmfont.c, so this rule will not normally be -# used. -standardppmdfont.c: standard.ppmdfont - ppmdcfont <$< >$@ +# To avoid major hassles with having ppmdcfont available here, we just ship a +# pre-made standardppmfont.c, so this rule will not normally be used. Though +# standardppmdfont.c depends upon standard.ppmdfont, we don't declare that +# here because when the user creates the source tree, the modification time of +# standard.ppmdfont may end up later than that of standardppmdfont.c, which +# would make the build want to rebuild it. +standardppmdfont.c: + ppmdcfont $@ # Note that we create a new compile.h only for the first make after a # make clean. This is good enough. We used to do stamp-date for diff --git a/lib/libsystem.c b/lib/libsystem.c index 4ff473dd..57073dce 100644 --- a/lib/libsystem.c +++ b/lib/libsystem.c @@ -436,14 +436,23 @@ pm_system2_vp(const char * const progName, */ int progStdinFd; + /* File descriptor that the processor program will get as Standard + Input + */ + bool weCreatedStdinFd; + /* This program created (opened) file descriptor 'progStdinFd', + as opposed to inheriting it. + */ pid_t feederPid; pid_t processorPid; int termStatus; - if (stdinFeeder) + if (stdinFeeder) { createPipeFeeder(stdinFeeder, feederParm, &progStdinFd, &feederPid); - else { + weCreatedStdinFd = true; + } else { progStdinFd = STDIN; + weCreatedStdinFd = false; feederPid = 0; } @@ -456,10 +465,6 @@ pm_system2_vp(const char * const progName, spawnProcessor(progName, argArray, progStdinFd, &progStdoutFd, &processorPid); - /* The child process has cloned our 'progStdinFd'; we have no - more use for our copy. - */ - close(progStdinFd); /* Dispose of the stdout from that child */ (*stdoutAccepter)(progStdoutFd, accepterParm); close(progStdoutFd); @@ -470,6 +475,13 @@ pm_system2_vp(const char * const progName, spawnProcessor(progName, argArray, progStdinFd, NULL, &processorPid); } + if (weCreatedStdinFd) { + /* The child process has cloned our 'progStdinFd'; we have no + more use for our copy. + */ + close(progStdinFd); + } + waitpid(processorPid, &termStatus, 0); if (feederPid) diff --git a/lib/libsystem_dummy.c b/lib/libsystem_dummy.c index c89b4d5d..97dd8984 100644 --- a/lib/libsystem_dummy.c +++ b/lib/libsystem_dummy.c @@ -21,6 +21,12 @@ pm_system_vp(const char * const progName, void * const feederParm, void stdoutAccepter(int, void *), void * const accepterParm) { + + pm_error("This program wants to run another program using pm_system_vp() " + "in the libnetpbm library, but libnetpbm was built without " + "the pm_system_vp() facility -- probably because this system " + "doesn't have the process management facilities pm_system() " + "requires."); } void @@ -30,6 +36,12 @@ pm_system_lp(const char * const progName, void stdoutAccepter(int, void *), void * const accepterParm, ...) { + + pm_error("This program wants to run another program using pm_system_lp() " + "in the libnetpbm library, but libnetpbm was built without " + "the pm_system_lp() facility -- probably because this system " + "doesn't have the process management facilities pm_system() " + "requires."); } void @@ -39,8 +51,8 @@ pm_system(void stdinFeeder(int, void *), void * const accepterParm, const char * const shellCommand) { - pm_error("This program wants to run another program using pm_system() in " - "the libnetpbm library, but libnetpbm was built without " + pm_error("This program wants to run another program using pm_system() " + "in the libnetpbm library, but libnetpbm was built without " "the pm_system() facility -- probably because this system " "doesn't have the process management facilities pm_system() " "requires."); diff --git a/version.mk b/version.mk index 671c59a4..ab41a04c 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 78 -NETPBM_POINT_RELEASE = 2 +NETPBM_POINT_RELEASE = 3 -- cgit 1.4.1