Mercurial > hg > audiodb
comparison create.cpp @ 591:0242e5d1643c
Address portability issues in database creation
Define a getpagesize() macro which returns The Right Thing on WIN32
Use Windows permissions flags in open() with O_CREAT.
author | mas01cr |
---|---|
date | Tue, 11 Aug 2009 21:42:24 +0000 |
parents | 4eedc18634f5 |
children | 31a1556fc2d6 |
comparison
equal
deleted
inserted
replaced
590:4eedc18634f5 | 591:0242e5d1643c |
---|---|
44 } | 44 } |
45 if(datadim == 0) { | 45 if(datadim == 0) { |
46 datadim = ADB_DEFAULT_DATADIM; | 46 datadim = ADB_DEFAULT_DATADIM; |
47 } | 47 } |
48 | 48 |
49 if ((fd = open(path, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0) { | 49 if ((fd = open(path, O_RDWR|O_CREAT|O_EXCL, |
50 #if defined(WIN32) | |
51 _S_IREAD|_S_IWRITE | |
52 #else | |
53 S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH | |
54 #endif | |
55 )) < 0) { | |
50 goto error; | 56 goto error; |
51 } | 57 } |
52 | 58 |
53 header = (adb_header_t *) malloc(sizeof(adb_header_t)); | 59 header = (adb_header_t *) malloc(sizeof(adb_header_t)); |
54 if(!header) { | 60 if(!header) { |