mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-12 03:21:08 +00:00
fix(native): the SysV segment lock is retried when a signal interrupts it
This commit is contained in:
1 parent
da30812c31
commit
27e45c744d
1 file changed
+5
-1
@@ -139,7 +139,11 @@ static int shm_mark_attached(int id, int attached) {
|
||||
static int shm_lock_dir(int op) {
|
||||
int fd = shm_open_file(".lock", O_RDWR | O_CREAT, 0600);
|
||||
if (fd < 0) return -1;
|
||||
if (syscall(SYS_flock, fd, op) != 0) {
|
||||
long rc;
|
||||
do {
|
||||
rc = syscall(SYS_flock, fd, op);
|
||||
} while (rc != 0 && errno == EINTR);
|
||||
if (rc != 0) {
|
||||
syscall(SYS_close, fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user