File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,7 +265,6 @@ declare -A types=(
265265 [file]=" $file ${types[link]} "
266266 [directory]=" . .. $dir $dir /linkdir"
267267 [pipe]=" $fifo "
268- [socket]=/dev/log
269268 [char]=" c . 0 @"
270269 [unsignedint]=123
271270 [int]=" 1 123 0 -1 -938945349"
@@ -279,21 +278,27 @@ declare -A types=(
279278 [portnumber]=1234
280279)
281280
281+ for socket in /dev/log
282+ do
283+ [[ -S $socket ]] || continue
284+ types[socket]=$socket
285+ done
286+
282287# Look for a terminal
283288for stdfd in 0 1 2
284289do
285- if [[ -t $stdfd ]]
290+ [[ -t $stdfd ]] || continue
291+ types[terminal]=$stdfd
292+ done
293+
294+ for t in terminal socket
295+ do
296+ if [[ ${types[$t]-unset} = unset ]]
286297 then
287- types[terminal]=$stdfd
288- break
298+ printf " No %s found: won't test.\n" " $t "
289299 fi
290300done
291301
292- if [[ ${types[terminal]-unset} = unset ]]
293- then
294- printf " No terminal found: won't test.\n"
295- fi
296-
297302# Test hostnames only if we can actually resolv.
298303if host localhost > /dev/null 2>&1
299304then
You can’t perform that action at this time.
0 commit comments