Lines 37-43
struct seminfo *__buf; /* buffer fo
Link Here
|
37 |
|
37 |
|
38 |
#define SEM_FLAGS (IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
38 |
#define SEM_FLAGS (IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
39 |
#define SHM_FLAGS (IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
39 |
#define SHM_FLAGS (IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
40 |
#define OPEN_FLAGS (O_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
40 |
#define OPEN_FLAGS (O_CREAT) |
|
|
41 |
#define OPEN_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
41 |
#define IS_MINE(a) (locks->_owner[a] == getpid()) |
42 |
#define IS_MINE(a) (locks->_owner[a] == getpid()) |
42 |
#define SET_OWNER(a) (locks->_owner[a] = getpid()) |
43 |
#define SET_OWNER(a) (locks->_owner[a] = getpid()) |
43 |
#define CLEAR_OWNER(a) (locks->_owner[a] = 0) |
44 |
#define CLEAR_OWNER(a) (locks->_owner[a] = 0) |
Lines 268-274
PLockInit()
Link Here
|
268 |
|
269 |
|
269 |
if (stat(LOCKFILE, &statbuf)) |
270 |
if (stat(LOCKFILE, &statbuf)) |
270 |
{ |
271 |
{ |
271 |
int fd = open(LOCKFILE, OPEN_FLAGS); |
272 |
int fd = open(LOCKFILE, OPEN_FLAGS, OPEN_MODE); |
272 |
if (fd < 0) |
273 |
if (fd < 0) |
273 |
{ |
274 |
{ |
274 |
fprintf(stderr, "initLocks: error accessing locks shared block: open\n"); |
275 |
fprintf(stderr, "initLocks: error accessing locks shared block: open\n"); |