summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-24 06:21:43 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-08-24 06:21:43 +0000
commitdea6ce41b404df35944ab6063c614497b1b2984e (patch)
tree154318e243567b27e3f8fae8fd301971d2d68be9 /ext
parenta85a9d31db29e366cce9efb9c3fab24e750ed498 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb.in15
-rw-r--r--ext/socket/socket.c7
2 files changed, 17 insertions, 5 deletions
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index b0cd861..c8e55e0 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -311,22 +311,27 @@ def create_header()
end
end
-def dir_config(target)
- dir = with_config("%s-dir"%target)
+def dir_config(target, idefault=nil, ldefault=nil)
+ if idefault && ldefault == nil
+ default = idefault
+ idefault = default + "/include"
+ ldefault = default + "/lib"
+ end
+ dir = with_config("%s-dir"%target, default)
if dir
idir = " -I"+dir+"/include"
ldir = " -L"+dir+"/lib"
end
unless idir
- dir = with_config("%s-include"%target)
+ dir = with_config("%s-include"%target, idefault)
idir = " -I"+dir if dir
end
unless ldir
- dir = with_config("%s-lib"%target)
+ dir = with_config("%s-lib"%target, ldefault)
ldir = " -L"+dir if dir
end
- $CPPFLAGS += idir if idir
+ $CFLAGS += idir if idir
$LDFLAGS += ldir if ldir
end
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index c65de56..c9df07c 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -1044,6 +1044,7 @@ s_accept(class, fd, sockaddr, len)
socklen_t *len;
{
int fd2;
+ int retry = 0;
rb_secure(3);
retry:
@@ -1053,6 +1054,12 @@ s_accept(class, fd, sockaddr, len)
TRAP_END;
if (fd2 < 0) {
switch (errno) {
+ case EMFILE:
+ case ENFILE:
+ if (retry) break;
+ rb_gc();
+ retry = 1;
+ goto retry;
case EINTR:
rb_thread_schedule();
goto retry;