mirror of
https://salsa.debian.org/ha-team/libqb
synced 2026-08-08 20:07:21 +00:00
ipc: use O_EXCL when opening IPC files
This commit is contained in:
parent
28dff090c7
commit
269a0ca007
@ -790,7 +790,7 @@ qb_ipcs_us_connect(struct qb_ipcs_service *s,
|
||||
|
||||
fd_hdr = qb_sys_mmap_file_open(path, r->request,
|
||||
SHM_CONTROL_SIZE,
|
||||
O_CREAT | O_TRUNC | O_RDWR);
|
||||
O_CREAT | O_TRUNC | O_RDWR | O_EXCL);
|
||||
if (fd_hdr < 0) {
|
||||
res = fd_hdr;
|
||||
errno = -fd_hdr;
|
||||
|
||||
@ -155,7 +155,7 @@ qb_rb_open_2(const char *name, size_t size, uint32_t flags,
|
||||
sizeof(struct qb_ringbuffer_shared_s) + shared_user_data_size;
|
||||
|
||||
if (flags & QB_RB_FLAG_CREATE) {
|
||||
file_flags |= O_CREAT | O_TRUNC;
|
||||
file_flags |= O_CREAT | O_TRUNC | O_EXCL;
|
||||
}
|
||||
|
||||
rb = calloc(1, sizeof(struct qb_ringbuffer_s));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user