diff --git a/ipc/sem.c b/ipc/sem.c index dbef95b..8986239 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -1224,8 +1224,18 @@ SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, error = try_atomic_semop (sma, sops, nsops, un, task_tgid_vnr(current)); if (error <= 0) { - if (alter && error == 0) - update_queue(sma, (nsops == 1) ? sops[0].sem_num : -1); + if (alter && error == 0) { + if (sma->complex_count) { + update_queue(sma, -1); + } else { + int i; + + for (i=0;i 0) + update_queue(sma, sops[i].sem_num); + } + } + } goto out_unlock_free; }