From 893b8363671346d779a8f47dc31d220b5e5560e5 Mon Sep 17 00:00:00 2001 From: Sergei Kolobov Date: Sat, 13 Dec 2003 00:25:50 +0000 Subject: - Add patch which remedies the problem of Zombie childs upon using the built-in shell/make utility which uses fork() - Switch to do-install target, respect ${PREFIX} - Bump PORTREVISION PR: 59760 Submitted by: maintainer --- editors/zed/Makefile | 14 ++++++++-- editors/zed/files/patch-main.cc | 61 +++++++++++++++++++++++++++++++++++++++++ editors/zed/pkg-plist | 8 ++++-- 3 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 editors/zed/files/patch-main.cc (limited to 'editors/zed') diff --git a/editors/zed/Makefile b/editors/zed/Makefile index b91fd2b837ea..dbdaccb01021 100644 --- a/editors/zed/Makefile +++ b/editors/zed/Makefile @@ -7,13 +7,21 @@ PORTNAME= zed PORTVERSION= 1.0.5 +PORTREVISION= 1 CATEGORIES= editors MASTER_SITES= http://zed.c3po.it/ MAINTAINER= exile@chamber.ee -COMMENT= Simple, fast, powerful, small, highly configurable TEXT EDITOR +COMMENT= Simple, small, fast, highly configurable text editor -post-install: - @${STRIP_CMD} ${PREFIX}/bin/zed +DOCS= CHANGES zed.doc + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/zed ${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/cfg/zedrc ${PREFIX}/etc/zedrc.sample +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR} +.endif .include diff --git a/editors/zed/files/patch-main.cc b/editors/zed/files/patch-main.cc new file mode 100644 index 000000000000..7b18f79b56ee --- /dev/null +++ b/editors/zed/files/patch-main.cc @@ -0,0 +1,61 @@ +--- main.cc.orig Fri Nov 28 16:17:58 2003 ++++ main.cc Fri Nov 28 14:44:27 2003 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #ifdef X11 + #include + #endif +@@ -91,6 +92,8 @@ + + /***************************************************************************/ + ++int fork2(); ++ + void resetcfg(int flag,char *str) + { + if (config.keys==(unsigned int *)0xffffffff) config.keys=0; +@@ -554,7 +557,7 @@ + + if (piped) pipe(pp); else deinit(); // ripristino i settaggi del terminale + +- if ((pid=fork())==0) ++ if ((pid=fork2())==0) + { // figlio + char *argv[100]; + int argc=0; +@@ -1352,6 +1355,32 @@ + deinit(); + + return(0); ++} ++ ++int fork2() { ++ pid_t pid; ++ int status; ++ ++ if (!(pid = fork())) { ++ switch (fork()) { ++ case 0: return 0; ++ case -1: _exit(errno); /* assumes all errnos are <256 */ ++ default: _exit(0); ++ } ++ } ++ ++ if (pid < 0 || waitpid(pid,&status,0) < 0) ++ return -1; ++ ++ if (WIFEXITED(status)) ++ if (WEXITSTATUS(status) == 0) ++ return 1; ++ else ++ errno = WEXITSTATUS(status); ++ else ++ errno = EINTR; /* well, sort of :-) */ ++ ++ return -1; + } + + /***************************************************************************/ diff --git a/editors/zed/pkg-plist b/editors/zed/pkg-plist index 8f24ace15d30..c485e4a6246f 100644 --- a/editors/zed/pkg-plist +++ b/editors/zed/pkg-plist @@ -1,4 +1,6 @@ +@comment $FreeBSD$ bin/zed -etc/zedrc -share/doc/zed/zed.doc -@dirrm share/doc/zed +etc/zedrc.sample +%%PORTDOCS%%%%DOCSDIR%%/CHANGES +%%PORTDOCS%%%%DOCSDIR%%/zed.doc +%%PORTDOCS%%@dirrm %%DOCSDIR%% -- cgit v1.2.3