patches/strace/4.5.17/190-dirent-include.patch
author Johannes Stezenbach <js@sig21.net>
Tue Oct 30 00:22:25 2012 +0000 (2012-10-30)
changeset 3097 5c67476c7342
permissions -rw-r--r--
scripts/functions: fix endless loop in debug-shell with IO redirection

CT_DEBUG_INTERACTIVE is disabled when stdin, stdout or
stderr are redirected, but the check is only done at
the start of the build and doesn't catch when individual
build commands use redirection. When stdin is redirected
it will cause the debug shell to exit immediately, causing
and endless loop. Thus, save the stdin/our/err file handles
and restore them before invoking the debug shell.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Message-Id: <20121030102225.GA8303@sig21.net>
Patchwork-Id: 195409
yann@1182
     1
--- strace-orig/file.c	2008/05/20 04:56:18	1.92
yann@1182
     2
+++ strace/file.c	2008/08/01 01:13:10	1.93
yann@1182
     3
@@ -28,21 +28,22 @@
yann@1182
     4
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
yann@1182
     5
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
yann@1182
     6
  *
yann@1182
     7
- *	$Id: file.c,v 1.92 2008/05/20 04:56:18 roland Exp $
yann@1182
     8
+ *	$Id: file.c,v 1.93 2008/08/01 01:13:10 roland Exp $
yann@1182
     9
  */
yann@1182
    10
 
yann@1182
    11
 #include "defs.h"
yann@1182
    12
 
yann@1182
    13
 #include <dirent.h>
yann@1182
    14
+
yann@1182
    15
 #ifdef LINUX
yann@1182
    16
-#define dirent kernel_dirent
yann@1182
    17
-#define dirent64 kernel_dirent64
yann@1182
    18
-#include <linux/types.h>
yann@1182
    19
-#include <linux/dirent.h>
yann@1182
    20
-#undef dirent
yann@1182
    21
-#undef dirent64
yann@1182
    22
+struct kernel_dirent {
yann@1182
    23
+	unsigned long   d_ino;
yann@1182
    24
+	unsigned long   d_off;
yann@1182
    25
+	unsigned short  d_reclen;
yann@1182
    26
+	char            d_name[1];
yann@1182
    27
+};
yann@1182
    28
 #else
yann@1182
    29
-#define kernel_dirent dirent
yann@1182
    30
+# define kernel_dirent dirent
yann@1182
    31
 #endif
yann@1182
    32
 
yann@1182
    33
 #ifdef LINUX