diff options
Diffstat (limited to 'src/main/extractor_ipc_gnu.c')
-rw-r--r-- | src/main/extractor_ipc_gnu.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/extractor_ipc_gnu.c b/src/main/extractor_ipc_gnu.c index 5400636..06e4a1b 100644 --- a/src/main/extractor_ipc_gnu.c +++ b/src/main/extractor_ipc_gnu.c | |||
@@ -145,7 +145,7 @@ EXTRACTOR_IPC_shared_memory_create_ (size_t size) | |||
145 | #if SOMEBSD | 145 | #if SOMEBSD |
146 | /* this works on FreeBSD, not sure about others... */ | 146 | /* this works on FreeBSD, not sure about others... */ |
147 | tpath = getenv ("TMPDIR"); | 147 | tpath = getenv ("TMPDIR"); |
148 | if (tpath == NULL) | 148 | if (NULL == tpath) |
149 | tpath = "/tmp/"; | 149 | tpath = "/tmp/"; |
150 | #else | 150 | #else |
151 | tpath = "/"; /* Linux */ | 151 | tpath = "/"; /* Linux */ |
@@ -153,10 +153,12 @@ EXTRACTOR_IPC_shared_memory_create_ (size_t size) | |||
153 | snprintf (shm->shm_name, | 153 | snprintf (shm->shm_name, |
154 | MAX_SHM_NAME, | 154 | MAX_SHM_NAME, |
155 | "%sLE-%u-%u", | 155 | "%sLE-%u-%u", |
156 | tpath, getpid (), | 156 | tpath, |
157 | getpid (), | ||
157 | (unsigned int) RANDOM ()); | 158 | (unsigned int) RANDOM ()); |
158 | if (-1 == (shm->shm_id = shm_open (shm->shm_name, | 159 | if (-1 == (shm->shm_id = shm_open (shm->shm_name, |
159 | O_RDWR | O_CREAT, S_IRUSR | S_IWUSR))) | 160 | O_RDWR | O_CREAT, |
161 | S_IRUSR | S_IWUSR))) | ||
160 | { | 162 | { |
161 | LOG_STRERROR_FILE ("shm_open", | 163 | LOG_STRERROR_FILE ("shm_open", |
162 | shm->shm_name); | 164 | shm->shm_name); |