diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2013-01-14 19:30:10 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2013-01-14 19:30:10 +0100 |
commit | a6ec475a92ebfb9ab42685cb63b42a39656705ab (patch) | |
tree | e18051a5a7514511a72a52cb6dc57965c1b21d28 /src/squeue/squeue.c | |
parent | 783222ed007f93d16bfb224df3d10ddb47bf4a74 (diff) | |
parent | a6ef73359c0e0537ebf83795ebacbbfaee2c9c28 (diff) | |
download | 0xFFFF-a6ec475a92ebfb9ab42685cb63b42a39656705ab.tar.bz2 |
Merge branch 'pvc' into legacylegacy
Diffstat (limited to 'src/squeue/squeue.c')
-rw-r--r-- | src/squeue/squeue.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/squeue/squeue.c b/src/squeue/squeue.c index 69bd595..0ed8815 100644 --- a/src/squeue/squeue.c +++ b/src/squeue/squeue.c @@ -40,13 +40,18 @@ struct squeue_t *squeue_open(const char *file, int mode) struct squeue_t *q; char *pool; int shmid; + int fd; key_t k; k = ftok(file, 0x34); if (k == -1) { perror("ftok"); squeue_release(file); - close(creat(file, 0666)); + if ((fd = creat(file, 0666)) == -1) { + perror("creat"); + return NULL; + } + close(fd); chmod(file, 0666); k = ftok(file, 0xa3); if (k == -1) { |