Skip to content

Commit

Permalink
Handle EMLINK on FreeBSD properly
Browse files Browse the repository at this point in the history
Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
  • Loading branch information
Garrett Cooper committed Apr 17, 2013
1 parent ae08aa0 commit 8035e2c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/open/16.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/sh
# $FreeBSD: head/tools/regression/pjdfstest/tests/open/16.t 219621 2011-03-13 19:35:13Z pjd $

desc="open returns ELOOP when O_NOFOLLOW was specified and the target is a symbolic link"
if [ "${os}" = "FreeBSD" ]; then
error=EMLINK
else
error=ELOOP
fi

desc="open returns $error when O_NOFOLLOW was specified and the target is a symbolic link"

dir=`dirname $0`
. ${dir}/../misc.sh
Expand All @@ -12,8 +18,8 @@ n0=`namegen`
n1=`namegen`

expect 0 symlink ${n0} ${n1}
expect ELOOP open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644
expect ELOOP open ${n1} O_RDONLY,O_NOFOLLOW
expect ELOOP open ${n1} O_WRONLY,O_NOFOLLOW
expect ELOOP open ${n1} O_RDWR,O_NOFOLLOW
expect $error open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644
expect $error open ${n1} O_RDONLY,O_NOFOLLOW
expect $error open ${n1} O_WRONLY,O_NOFOLLOW
expect $error open ${n1} O_RDWR,O_NOFOLLOW
expect 0 unlink ${n1}

0 comments on commit 8035e2c

Please sign in to comment.