1
#!/bin/sh /usr/share/dpatch/dpatch-run
2
## 12-fdout.dpatch by Ian Jackson <iwj@ubuntu.com>
4
## DP: expBusy forgets to open fdout (Closes: #440818).
8
diff -Naurp expect-5.43.orig/exp_command.c expect-5.43/exp_command.c
9
--- expect-5.43.orig/exp_command.c 2004-08-20 17:18:01.000000000 +0000
10
+++ expect-5.43/exp_command.c 2007-09-04 19:30:20.000000000 +0000
11
@@ -310,7 +310,15 @@ expBusy(esPtr)
12
fcntl(x,F_DUPFD,esPtr->fdin);
15
- expCloseOnExec(esPtr->fdin);
16
+ if (esPtr->fdout != EXP_NOFD &&
17
+ esPtr->fdout != esPtr->fdin) {
18
+ fcntl(esPtr->fdin,F_DUPFD,esPtr->fdout);
20
+ if (esPtr->fdin > 2)
21
+ expCloseOnExec(esPtr->fdin);
22
+ if (esPtr->fdout != EXP_NOFD &&
24
+ expCloseOnExec(esPtr->fdout);