<commit_before>#!/bin/sh
# $FreeBSD$

desc="open returns EMLINK/ELOOP when O_NOFOLLOW was specified and the target is a symbolic link"

dir=`dirname $0`
. ${dir}/../misc.sh

echo "1..6"

n0=`namegen`
n1=`namegen`

expect 0 symlink ${n0} ${n1}
case "${os}" in
SunOS)
	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 EMLINK open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644
	expect EMLINK open ${n1} O_RDONLY,O_NOFOLLOW
	expect EMLINK open ${n1} O_WRONLY,O_NOFOLLOW
	expect EMLINK open ${n1} O_RDWR,O_NOFOLLOW
	;;
esac
expect 0 unlink ${n1}<commit_msg>Shorter version.<commit_after>#!/bin/sh
# $FreeBSD$

desc="open returns EMLINK/ELOOP when O_NOFOLLOW was specified and the target is a symbolic link"

dir=`dirname $0`
. ${dir}/../misc.sh

echo "1..6"

n0=`namegen`
n1=`namegen`

expect 0 symlink ${n0} ${n1}
expect "EMLINK|ELOOP" open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644
expect "EMLINK|ELOOP" open ${n1} O_RDONLY,O_NOFOLLOW
expect "EMLINK|ELOOP" open ${n1} O_WRONLY,O_NOFOLLOW
expect "EMLINK|ELOOP" open ${n1} O_RDWR,O_NOFOLLOW
expect 0 unlink ${n1}
{'fraction_non_alphanumeric': 0.1396508728179551, 'fraction_numerical': 0.03657522859517872, 'mean_word_length': 5.615384615384615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2543854', 'n_tokens_mistral': 581, 'n_tokens_neox': 536, 'n_words': 132}