1271294Sngie#!/bin/sh
2271294Sngie# $FreeBSD: head/tools/regression/pjdfstest/tests/open/22.t 211352 2010-08-15 21:24:17Z pjd $
3271294Sngie
4271294Sngiedesc="open returns EEXIST when O_CREAT and O_EXCL were specified and the file exists"
5271294Sngie
6271294Sngiedir=`dirname $0`
7271294Sngie. ${dir}/../misc.sh
8271294Sngie
9271294Sngieecho "1..21"
10271294Sngie
11271294Sngien0=`namegen`
12271294Sngie
13271294Sngiefor type in regular dir fifo block char socket symlink; do
14271294Sngie	create_file ${type} ${n0}
15271294Sngie	expect EEXIST open ${n0} O_CREAT,O_EXCL 0644
16271294Sngie	if [ "${type}" = "dir" ]; then
17271294Sngie		expect 0 rmdir ${n0}
18271294Sngie	else
19271294Sngie		expect 0 unlink ${n0}
20271294Sngie	fi
21271294Sngiedone
22