~ubuntu-branches/ubuntu/natty/expect-tcl8.3/natty

« back to all changes in this revision

Viewing changes to debian/patches/12-fdout.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-07-30 22:33:52 UTC
  • mfrom: (2.1.3 hardy)
  • Revision ID: james.westby@ubuntu.com-20080730223352-43j8vqcvoife73ck
Tags: 5.43.0-6
* Install expectk in expectk-tk8.3. Closes: #492288.
* Include expect scripts in expect-tcl8.3-dev as binaries, not as
  examples. Closes: #461357.
* expect-tcl8.3-dev: Depend on tk8.3-dev.
* Acknowledge NMU. Closes: #443393.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh /usr/share/dpatch/dpatch-run
 
2
## 12-fdout.dpatch by Ian Jackson <iwj@ubuntu.com>
 
3
##
 
4
## DP: expBusy forgets to open fdout (Closes: #440818).
 
5
 
 
6
@DPATCH@
 
7
 
 
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);
 
13
     close(x);
 
14
   }
 
15
-  expCloseOnExec(esPtr->fdin);
 
16
+  if (esPtr->fdout != EXP_NOFD &&
 
17
+      esPtr->fdout != esPtr->fdin) {
 
18
+    fcntl(esPtr->fdin,F_DUPFD,esPtr->fdout);
 
19
+  }
 
20
+  if (esPtr->fdin > 2)
 
21
+    expCloseOnExec(esPtr->fdin);
 
22
+  if (esPtr->fdout != EXP_NOFD &&
 
23
+      esPtr->fdout > 2)
 
24
+    expCloseOnExec(esPtr->fdout);
 
25
   esPtr->fdBusy = TRUE;
 
26
 }
 
27