xref: /openbsd/regress/sys/ffs/tests/open/22.t (revision 771fbea0)
1#!/bin/sh
2# $FreeBSD: src/tools/regression/fstest/tests/open/22.t,v 1.1 2007/01/17 01:42:10 pjd Exp $
3
4desc="open returns EEXIST when O_CREAT and O_EXCL were specified and the file exists"
5
6n0=`namegen`
7
8expect 0 create ${n0} 0644
9expect EEXIST open ${n0} O_CREAT,O_EXCL 0644
10expect 0 unlink ${n0}
11
12expect 0 mkdir ${n0} 0755
13expect EEXIST open ${n0} O_CREAT,O_EXCL 0644
14expect 0 rmdir ${n0}
15
16expect 0 mkfifo ${n0} 0644
17expect EEXIST open ${n0} O_CREAT,O_EXCL 0644
18expect 0 unlink ${n0}
19
20expect 0 symlink test ${n0}
21expect EEXIST open ${n0} O_CREAT,O_EXCL 0644
22expect 0 unlink ${n0}
23