From: Andrew Tridgell Date: Wed, 2 May 2001 07:58:40 +0000 (+0000) Subject: use O_EXCL for fcntl_lock.c test in case some fool runs on /tmp X-Git-Tag: samba-2.2.5pre1~2087^2~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d3d7a0d673b80f1de411a5fb5a23ae06cf80f43;p=thirdparty%2Fsamba.git use O_EXCL for fcntl_lock.c test in case some fool runs on /tmp --- diff --git a/source/tests/fcntl_lock.c b/source/tests/fcntl_lock.c index 3cd0e5ff5ed..1b790b0a97a 100644 --- a/source/tests/fcntl_lock.c +++ b/source/tests/fcntl_lock.c @@ -74,7 +74,8 @@ int main(int argc, char *argv[]) } } - fd = open(DATA, O_RDWR|O_CREAT|O_TRUNC, 0600); + unlink(DATA); + fd = open(DATA, O_RDWR|O_CREAT|O_EXCL, 0600); if (fd == -1) { fprintf(stderr,"ERROR: failed to open %s (errno=%d)\n",