Keep reducing jobs on ENOMEM for shmget()
authorJens Axboe <axboe@kernel.dk>
Wed, 1 Feb 2012 19:11:01 +0000 (20:11 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Feb 2012 19:11:01 +0000 (20:11 +0100)
Some platforms return ENOMEM, not just EINVAL, for too large
a size.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c

diff --git a/init.c b/init.c
index 4a3716bfeb5c058c235e9e529e73c4addef210b2..8dc57845ee24605ea316e6252ca8f5684365d74c 100644 (file)
--- a/init.c
+++ b/init.c
@@ -255,7 +255,7 @@ static int setup_thread_area(void)
                shm_id = shmget(0, size, IPC_CREAT | 0600);
                if (shm_id != -1)
                        break;
-               if (errno != EINVAL) {
+               if (errno != EINVAL && errno != ENOMEM) {
                        perror("shmget");
                        break;
                }