Accepting request 892068 from devel:languages:tcl
- bsc#1183904, expect-errorfd.patch: errorfd file descriptors should be closed when forking OBS-URL: https://build.opensuse.org/request/show/892068 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/expect?expand=0&rev=30
This commit is contained in:
commit
36c25e3ceb
44
expect-errorfd.patch
Normal file
44
expect-errorfd.patch
Normal file
@ -0,0 +1,44 @@
|
||||
Index: exp_clib.c
|
||||
==================================================================
|
||||
--- exp_clib.c
|
||||
+++ exp_clib.c
|
||||
@@ -2043,11 +2043,16 @@
|
||||
|
||||
#endif /* SYSV3 */
|
||||
#endif /* DO_SETSID */
|
||||
|
||||
/* save error fd while we're setting up new one */
|
||||
+#ifdef F_DUPFD_CLOEXEC
|
||||
+ errorfd = fcntl(2,F_DUPFD_CLOEXEC,3);
|
||||
+#else
|
||||
errorfd = fcntl(2,F_DUPFD,3);
|
||||
+ fcntl(errorfd, F_SETFD, FD_CLOEXEC);
|
||||
+#endif /* F_DUPFD_CLOXEC */
|
||||
/* and here is the macro to restore it */
|
||||
#define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);}
|
||||
|
||||
if (exp_autoallocpty) {
|
||||
|
||||
|
||||
Index: exp_command.c
|
||||
==================================================================
|
||||
--- exp_command.c
|
||||
+++ exp_command.c
|
||||
@@ -1159,11 +1159,16 @@
|
||||
|
||||
/* save stderr elsewhere to avoid BSD4.4 bogosity that warns */
|
||||
/* if stty finds dev(stderr) != dev(stdout) */
|
||||
|
||||
/* save error fd while we're setting up new one */
|
||||
+#ifdef F_DUPFD_CLOEXEC
|
||||
+ errorfd = fcntl(2,F_DUPFD_CLOEXEC,3);
|
||||
+#else
|
||||
errorfd = fcntl(2,F_DUPFD,3);
|
||||
+ fcntl(errorfd, F_SETFD, FD_CLOEXEC);
|
||||
+#endif /* F_DUPFD_CLOXEC */
|
||||
/* and here is the macro to restore it */
|
||||
#define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);}
|
||||
|
||||
close(0);
|
||||
close(1);
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon May 10 13:44:24 UTC 2021 - Reinhard Max <max@suse.com>
|
||||
|
||||
- bsc#1183904, expect-errorfd.patch:
|
||||
errorfd file descriptors should be closed when forking
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 4 11:02:42 UTC 2021 - Matthias Gerstner <matthias.gerstner@suse.com>
|
||||
|
||||
|
@ -29,6 +29,7 @@ Patch1: expect.patch
|
||||
Patch2: expect-fixes.patch
|
||||
Patch3: expect-log.patch
|
||||
Patch4: config-guess-sub-update.patch
|
||||
Patch5: expect-errorfd.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: tcl-devel
|
||||
|
||||
@ -57,6 +58,7 @@ expect package loaded.
|
||||
%patch2
|
||||
%patch3
|
||||
%patch4
|
||||
%patch5
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags} -fPIC -pie"
|
||||
|
Loading…
Reference in New Issue
Block a user