[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Check for only regular files, not devices
From: |
Stas Maximov |
Subject: |
[PATCH] Check for only regular files, not devices |
Date: |
Sat, 31 May 2008 15:52:14 -0700 (PDT) |
>From 350a7ce8fd29a7c225bea2ecb7e2443ee6269ea7 Mon Sep 17 00:00:00 2001
From: Stas Maximov <address@hidden>
Date: Sat, 31 May 2008 14:14:31 -0700
Subject: [PATCH] Check for only regular files, not devices
* libltdl/config/ltmain.m4sh, functions func_lalib_p () and
func_lalib_unsafe_p () should try reading only regular files and not
device files. This will avoid blocking libtool executing gdb, when
a pseudo-terminal device /dev/pts/NN is given as one of the arguments
to gdb: libtool --mode=execute gdb -q -nw -i mi -tty /dev/pts/4 prog
Signed-off-by: Stas Maximov <address@hidden>
---
libltdl/config/ltmain.m4sh | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 144bc76..5638b2e 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -451,8 +451,9 @@ $opt_help || {
# determined imposters.
func_lalib_p ()
{
- $SED -e 4q "$1" 2>/dev/null \
- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
}
# func_lalib_unsafe_p file
@@ -465,7 +466,7 @@ func_lalib_p ()
func_lalib_unsafe_p ()
{
lalib_p=no
- if test -r "$1" && exec 5<&0 <"$1"; then
+ if test -f "$1" -a -r "$1" && exec 5<&0 <"$1"; then
for lalib_p_l in 1 2 3 4
do
read lalib_p_line
--
1.5.5.1
- [PATCH] Check for only regular files, not devices,
Stas Maximov <=