From 8595f845b3903907adaa614443a582179e5da22a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Feb 2011 10:11:34 +0000 Subject: run GC on ENOSPC when calling mq_open() It could work... --- ext/posix_mq/posix_mq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ext/posix_mq/posix_mq.c') diff --git a/ext/posix_mq/posix_mq.c b/ext/posix_mq/posix_mq.c index cb4cacc..05f407d 100644 --- a/ext/posix_mq/posix_mq.c +++ b/ext/posix_mq/posix_mq.c @@ -438,7 +438,11 @@ static VALUE init(int argc, VALUE *argv, VALUE self) mq->des = (mqd_t)xopen(&x); if (mq->des == MQD_INVALID) { - if (errno == ENOMEM || errno == EMFILE || errno == ENFILE) { + switch (errno) { + case ENOMEM: + case EMFILE: + case ENFILE: + case ENOSPC: rb_gc(); mq->des = (mqd_t)xopen(&x); } -- cgit v1.2.3-24-ge0c7