- /*
- * Try creating shm (or get rw access). We don't do an exclusive open,
- * because we allow other processes to create+ftruncate it
- * concurrently.
- */
- wait_shm_fd = shm_open(shm_path, O_RDWR | O_CREAT, mode);
- if (wait_shm_fd >= 0) {
- ret = ftruncate(wait_shm_fd, mmap_size);
- if (ret < 0) {
- perror("ftruncate wait shm");
- exit(EXIT_FAILURE);
- }
+ ret = ftruncate(wait_shm_fd, mmap_size);
+ if (ret < 0) {
+ perror("ftruncate wait shm");
+ exit(EXIT_FAILURE);
+ }