texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[6050] check for mknod usability


From: karl
Subject: [6050] check for mknod usability
Date: Sun, 18 Jan 2015 19:37:05 +0000

Revision: 6050
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6050
Author:   karl
Date:     2015-01-18 19:37:05 +0000 (Sun, 18 Jan 2015)
Log Message:
-----------
check for mknod usability

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/t/Init-inter.inc

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-01-18 18:13:51 UTC (rev 6049)
+++ trunk/ChangeLog     2015-01-18 19:37:05 UTC (rev 6050)
@@ -1,3 +1,8 @@
+2015-01-18  Karl Berry  <address@hidden>
+
+       * info/t/Init-inter.inc: if mknod doesn't exist,
+       or mknod ... p fails, exit 77.
+
 2015-01-15  Gavin Smith  <address@hidden>
 
        * info/t/Init-inter.inc: (findprog) Add function from util/texi2dvi.

Modified: trunk/info/t/Init-inter.inc
===================================================================
--- trunk/info/t/Init-inter.inc 2015-01-18 18:13:51 UTC (rev 6049)
+++ trunk/info/t/Init-inter.inc 2015-01-18 19:37:05 UTC (rev 6050)
@@ -16,33 +16,8 @@
 # Initialize test of interactive operation
 # This file is to be sourced, not run directly
 
-# Avoid ginfo complaining that terminal is too dumb
-TERM=vt100; export TERM
+#  we may look up whether a couple of utilities exist.
 
-FINISHEDFIFO=t/`basename $0.finished`
-
-# Create named pipes to communicate with pseudotty program
-rm -f $PIPEIN $PIPEOUT
-mknod $PIPEIN p
-mknod $PIPEOUT p
-PTY_TYPE=$PIPEOUT
-
-# We can feed input bytes into $PTY_TYPE to be passed onto ginfo.  pseudotty
-# only reads from fd 3, but opening the pipe read-write means: (i) there will
-# always be a process with it open for writing, so pseudotty will not hang when
-# opening it; and (ii) select() will never return for an end-of-file on fd 3.
-./pseudotty >$PIPEIN 3<>$PTY_TYPE &
-PTY_PID=$!
-
-# Get name of pseudo-terminal slave device
-read PTS_DEVICE <$PIPEIN
-
-# glibc can kill a running process if it detects a condition like a
-# double free.  This specifies that the message it prints when it does
-# this should be sent to stderr so it can be recorded in the test *.log
-# files.
-LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR
-
 # Systems which define $COMSPEC or $ComSpec use semicolons to separate
 # directories in TEXINPUTS -- except for Cygwin et al., where COMSPEC
 # might be inherited, but : is used.
@@ -77,6 +52,48 @@
   return 1
 }
 
+# 
+# Avoid ginfo complaining that terminal is too dumb
+TERM=vt100; export TERM
+
+FINISHEDFIFO=t/`basename $0.finished`
+
+# Create named pipes to communicate with pseudotty program, or quit.
+rm -f $PIPEIN $PIPEOUT  # must already be defined
+if findprog mknod; then # check for mknod to give a better error msg
+  mknod $PIPEIN p
+  mknod $PIPEIN p
+  mknod $PIPEOUT p
+  PTY_TYPE=$PIPEOUT
+  #
+  if test ! -r $PIPEIN || test ! -r $PIPEOUT; then
+    echo "$0: could not mknod pipes" >&2
+    exit 77
+  fi
+  # ok, we'll proceed with the test.
+else
+  echo "$0: mknod program not found - cannot make named pipes" >&2
+  exit 77
+fi
+
+# fixme: must check for <> support.
+
+# We can feed input bytes into $PTY_TYPE to be passed onto ginfo.  pseudotty
+# only reads from fd 3, but opening the pipe read-write means: (i) there will
+# always be a process with it open for writing, so pseudotty will not hang when
+# opening it; and (ii) select() will never return for an end-of-file on fd 3.
+./pseudotty >$PIPEIN 3<>$PTY_TYPE &
+PTY_PID=$!
+
+# Get name of pseudo-terminal slave device
+read PTS_DEVICE <$PIPEIN
+
+# glibc can kill a running process if it detects a condition like a
+# double free.  This specifies that the message it prints when it does
+# this should be sent to stderr so it can be recorded in the test *.log
+# files.
+LIBC_FATAL_STDERR_=1; export LIBC_FATAL_STDERR
+
 run_ginfo ()
 {
   rm -f $FINISHEDFIFO
@@ -124,6 +141,7 @@
     echo 'pgrep program not found - cannot get PID of ginfo process' >&2
     GINFO_PID=unknown
   fi
+  #
   # If the PID is unknown, wait for a short time to wait for the program 
   # to start.  Normally this isn't needed, but on a few tests, it breaks
   # otherwise, possibly because some bytes have special meaning to the 
@@ -131,5 +149,3 @@
   # turned off yet.
   test $GINFO_PID = unknown && sleep 1
 }
-
-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]