1#!/bin/sh
| 1#!/bin/sh
|
2# $FreeBSD: head/tools/regression/pjdfstest/tests/link/10.t 166065 2007-01-17 01:42:12Z pjd $
| 2# $FreeBSD: head/tools/regression/pjdfstest/tests/link/10.t 211474 2010-08-18 22:06:43Z pjd $
|
3 4desc="link returns EEXIST if the destination file does exist" 5 6dir=`dirname $0` 7. ${dir}/../misc.sh 8
| 3 4desc="link returns EEXIST if the destination file does exist" 5 6dir=`dirname $0` 7. ${dir}/../misc.sh 8
|
9echo "1..14"
| 9echo "1..23"
|
10 11n0=`namegen` 12n1=`namegen` 13 14expect 0 create ${n0} 0644 15
| 10 11n0=`namegen` 12n1=`namegen` 13 14expect 0 create ${n0} 0644 15
|
16expect 0 create ${n1} 0644 17expect EEXIST link ${n0} ${n1} 18expect 0 unlink ${n1}
| 16for type in regular dir fifo block char socket symlink; do 17 create_file ${type} ${n1} 18 expect EEXIST link ${n0} ${n1} 19 if [ "${type}" = "dir" ]; then 20 expect 0 rmdir ${n1} 21 else 22 expect 0 unlink ${n1} 23 fi 24done
|
19
| 25
|
20expect 0 mkdir ${n1} 0755 21expect EEXIST link ${n0} ${n1} 22expect 0 rmdir ${n1} 23 24expect 0 symlink test ${n1} 25expect EEXIST link ${n0} ${n1} 26expect 0 unlink ${n1} 27 28expect 0 mkfifo ${n1} 0644 29expect EEXIST link ${n0} ${n1} 30expect 0 unlink ${n1} 31
| |
32expect 0 unlink ${n0}
| 26expect 0 unlink ${n0}
|