Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 1 | # make sure we have a way of checking these things |
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 2 | cd /proc/$$/fd || cd /dev/fd || exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 3 | |
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 4 | [ -e 44 ] && exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 5 | exec 44>/dev/null |
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 6 | [ -e 44 ] || exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 7 | echo pass fd out open |
8 | |||||
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 9 | [ -e 55 ] && exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 10 | exec 55>&44 |
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 11 | [ -e 55 ] || exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 12 | echo pass fd out dup |
13 | |||||
14 | exec 44>&- | ||||
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 15 | [ -e 44 ] && exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 16 | echo pass fd out close |
17 | |||||
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 18 | [ -e 66 ] && exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 19 | exec 66</dev/null |
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 20 | [ -e 66 ] || exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 21 | echo pass fd in open |
22 | |||||
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 23 | [ -e 77 ] && exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 24 | exec 77<&66 |
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 25 | [ -e 77 ] || exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 26 | echo pass fd in dup |
27 | |||||
28 | exec 66<&- | ||||
Denis Vlasenko | 6c9be7f | 2009-04-07 02:29:51 +0000 | [diff] [blame] | 29 | [ -e 66 ] && exit 1 |
Mike Frysinger | 3c7167b | 2009-04-06 12:36:10 +0000 | [diff] [blame] | 30 | echo pass fd in close |