Initialize sequence numbers to 0 in seminit() instead of using whatever
garbage happens to be in memory. This did not seem to cause any problems except making semaphore ID's unpredictable (and ugly in ipcs(1) output).
This commit is contained in:
parent
759577e793
commit
9e7ac78554
@ -198,6 +198,7 @@ seminit(void)
|
||||
for (i = 0; i < seminfo.semmni; i++) {
|
||||
sema[i].sem_base = 0;
|
||||
sema[i].sem_perm.mode = 0;
|
||||
sema[i].sem_perm.seq = 0;
|
||||
}
|
||||
for (i = 0; i < seminfo.semmni; i++)
|
||||
mtx_init(&sema_mtx[i], "semid", NULL, MTX_DEF);
|
||||
|
Loading…
x
Reference in New Issue
Block a user