Debian Codegraph @

src/testsuite/daemon-fd-test

raw
1 #! /bin/sh
2
3 if [ -z "$srcdir" ] ; then
4 srcdir=`pwd`
5 fi
6
7 . $srcdir/functions.sh
8
9 [ -d /proc/self/fd ] || test_skip
10
11 # Opens a spurios fd 9.
12 exec 9>&2
13
14 # Ignore fd 3, since it's used by the ls program to get to read the
15 # directory. On linux, fd 3 should be a link to the appropriate
16 # "/proc/<pid>/fd" directory, while on Solaris, it for some reason is
17 # a link to "/".
18
19 spawn_lshd && exec_lsh ls /proc/self/fd | grep -v '^3$'> test.out1
20 cat >test.out2 <<EOF
21 0
22 1
23 2
24 EOF
25
26 compare_output "daemon-fd-test"