summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorJoseph Koshy <jkoshy@FreeBSD.org>2003-06-17 01:31:54 +0000
committerJoseph Koshy <jkoshy@FreeBSD.org>2003-06-17 01:31:54 +0000
commitcf8e9ef60bc1f04a04045f4b6d4b3b9a1075c622 (patch)
tree81b2000fd80119b6589f9779862eaed080f35c72 /graphics
parentNew port: sysutils/dvd+rw-tools (diff)
Add a patch that makes PEPS check the exit status of the 'gs' pipeline
that it invokes. This allows a faulty EPS file to stop a documentation build rather than silently produce corrupted images. Bump PORTREVISION. Approved by: petef [MAINTAINER]
Notes
Notes: svn path=/head/; revision=83132
Diffstat (limited to 'graphics')
-rw-r--r--graphics/peps/Makefile1
-rw-r--r--graphics/peps/files/patch-peps.c37
2 files changed, 38 insertions, 0 deletions
diff --git a/graphics/peps/Makefile b/graphics/peps/Makefile
index d73f4ff30acc..21b6a7d2a342 100644
--- a/graphics/peps/Makefile
+++ b/graphics/peps/Makefile
@@ -7,6 +7,7 @@
PORTNAME= peps
PORTVERSION= 1.0
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= petef
diff --git a/graphics/peps/files/patch-peps.c b/graphics/peps/files/patch-peps.c
new file mode 100644
index 000000000000..93e23e2a9f55
--- /dev/null
+++ b/graphics/peps/files/patch-peps.c
@@ -0,0 +1,37 @@
+--- peps.c- Thu Jul 5 05:29:56 2001
++++ peps.c Mon Jun 16 15:13:13 2003
+@@ -62,6 +62,7 @@
+ */
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <sys/wait.h>
+
+ char gsargs[] = "gs "
+ "-q "
+@@ -181,7 +182,8 @@
+ }
+
+ int main(int argc, char *argv[]) {
+- register int i;
++ register int i;
++ int status, error;
+ register char *charptr;
+ FILE *gs, *eps;
+
+@@ -420,8 +422,14 @@
+ input, input
+ );
+
+- pclose(gs);
++ status = pclose(gs);
+
+- return 0;
++ error = !WIFEXITED(status) || WEXITSTATUS(status);
++
++ if (error && output)
++ (void) remove(output);
++
++ exit(error);
++
+ }
+