diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-12-16 14:06:09 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-12-16 14:06:09 +0000 |
commit | 637c3ed4a3a99f37e7c7a7a1015934fae5621d27 (patch) | |
tree | b4517dba4ed9015832f1c9743590ec896babed6e /source3 | |
parent | 59fcf1410749f7a233d87374f9d6d98501cd7ef3 (diff) | |
download | samba-637c3ed4a3a99f37e7c7a7a1015934fae5621d27.tar.gz samba-637c3ed4a3a99f37e7c7a7a1015934fae5621d27.tar.bz2 samba-637c3ed4a3a99f37e7c7a7a1015934fae5621d27.zip |
- handle ENOSPC in shmem init.
- be a little bit more friendly about grabbing semaphores
(This used to be commit 87f88708939a3b72b26716a0d6648c4ea2d14047)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/locking/shmem_sysv.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/locking/shmem_sysv.c b/source3/locking/shmem_sysv.c index 826de5694c..665cd8e7b4 100644 --- a/source3/locking/shmem_sysv.c +++ b/source3/locking/shmem_sysv.c @@ -557,8 +557,9 @@ struct shmem_ops *sysv_shm_open(int ronly) while (hash_size > 1) { sem_id = semget(SEMAPHORE_KEY, hash_size+1, IPC_CREAT|IPC_EXCL| SEMAPHORE_PERMS); - if (sem_id != -1 || errno != EINVAL) break; - hash_size--; + if (sem_id != -1 || + (errno != EINVAL && errno != ENOSPC)) break; + hash_size -= 5; } if (sem_id == -1) { @@ -639,8 +640,9 @@ struct shmem_ops *sysv_shm_open(int ronly) while (shm_size > MIN_SHM_SIZE) { shm_id = shmget(SHMEM_KEY, shm_size, IPC_CREAT | IPC_EXCL | IPC_PERMS); - if (shm_id != -1 || errno != EINVAL) break; - shm_size *= 0.9; + if (shm_id != -1 || + (errno != EINVAL && errno != ENOSPC)) break; + shm_size *= 0.8; } created_new = (shm_id != -1); } |