After upgrade to 0.99.19 jed was freezing when called with -c, fix it now.

Reported by:	andrew clarke <mail@ozzmosis.com>
Obtained from:	Author by email
This commit is contained in:
Renato Botelho 2009-12-21 14:53:02 +00:00
parent 2698bcd8c2
commit 65ba6801eb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=246368
2 changed files with 26 additions and 1 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= jed
PORTVERSION= 0.99.19
PORTREVISION= 1
CATEGORIES= editors
MASTER_SITES= ftp://space.mit.edu/pub/davis/jed/v${PORTVERSION:R}/ \
ftp://ftp.uni-stuttgart.de/pub/unix/misc/slang/jed/v${PORTVERSION:R}/ \
@ -17,7 +18,7 @@ DISTNAME= ${PORTNAME}-${PORTVERSION:R}-${PORTVERSION:E}
MAINTAINER= garga@FreeBSD.org
COMMENT= A SLang-based text editor
LIB_DEPENDS= slang.2:${PORTSDIR}/devel/libslang2
LIB_DEPENDS= slang.2:${PORTSDIR}/devel/libslang2
CONFLICTS= jed-devel-[0-9]*

View File

@ -0,0 +1,24 @@
--- src/unix.c
+++ src/unix.c
@@ -211,8 +211,19 @@ static void set_process_group (void)
{
pid_t pid = getpid ();
Startup_PGID = getpgid (pid);
- (void) tcsetpgrp (Read_FD, pid);
- (void) setpgid (pid, pid);
+ if (-1 == tcsetpgrp (Read_FD, pid))
+ {
+ fprintf (stderr, "tcsetpgrp failed\n");
+ Terminal_PGID = -1;
+ return;
+ }
+ if (-1 == setpgid (pid, pid))
+ {
+ fprintf (stderr, "setpgid failed\n");
+ (void) tcsetpgrp (Read_FD, Startup_PGID);
+ Terminal_PGID = -1;
+ return;
+ }
}
#endif
}