mariadb/newbrt/tests/test_oexcl.c
Bradley C. Kuszmaul cd8840f04d Get rid of icc warnings (with port-win warnings.) Addresss #1185.
git-svn-id: file:///svn/tokudb.1131b+1080a+1185+nostatementexprs@6466 c7de825b-a66e-492c-adef-691d508d4ae1
2013-04-16 23:57:21 -04:00

16 lines
474 B
C

/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
#include "includes.h"
#define fname __FILE__ ".tmp"
int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__unused__))) {
unlink(fname);
int fd0 = open (fname, O_RDWR|O_CREAT|O_EXCL, 0777);
assert(fd0>=0);
int fd1 = open (fname, O_RDWR|O_CREAT|O_EXCL, 0777);
assert(fd1==-1);
assert(errno==EEXIST);
return 0;
}