2007-11-29 14:18:54 +00:00
|
|
|
/* -*- mode: C; c-basic-offset: 4 -*- */
|
2008-01-24 15:10:32 +00:00
|
|
|
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
|
2007-11-29 14:18:54 +00:00
|
|
|
|
2013-04-16 23:57:32 -04:00
|
|
|
#include "test.h"
|
|
|
|
|
2013-04-16 23:57:21 -04:00
|
|
|
#include "includes.h"
|
2007-11-18 12:48:36 +00:00
|
|
|
|
|
|
|
#define fname __FILE__ ".tmp"
|
|
|
|
|
2013-04-16 23:57:32 -04:00
|
|
|
int
|
|
|
|
test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute__((__unused__))) {
|
2013-04-16 23:57:39 -04:00
|
|
|
unlink_file_and_bit(fname);
|
2013-04-16 23:57:27 -04:00
|
|
|
int fd0 = open (fname, O_RDWR|O_CREAT|O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO);
|
2007-11-18 12:48:36 +00:00
|
|
|
assert(fd0>=0);
|
2013-04-16 23:57:27 -04:00
|
|
|
int fd1 = open (fname, O_RDWR|O_CREAT|O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO);
|
2007-11-18 12:48:36 +00:00
|
|
|
assert(fd1==-1);
|
|
|
|
assert(errno==EEXIST);
|
|
|
|
return 0;
|
|
|
|
}
|