From d7a959f117b0d7ce3dbf03de28a5e04a33684624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Date: Sun, 5 May 2019 11:57:46 +0200 Subject: We don't allow unsetting O_NONBLOCK or O_NDELAY on packaged FS diff --git a/ruby.c b/ruby.c index 2c8b29a..9449a17 100644 --- a/ruby.c +++ b/ruby.c @@ -2045,10 +2045,10 @@ open_load_file(VALUE fname_v, int *xflag) int fd; /* open(2) may block if fname is point to FIFO and it's empty. Let's use O_NONBLOCK. */ -#if defined O_NONBLOCK && HAVE_FCNTL && !(O_NONBLOCK & O_ACCMODE) +#if defined O_NONBLOCK && HAVE_FCNTL && !(O_NONBLOCK & O_ACCMODE) && !defined(__HAIKU__) /* TODO: fix conflicting O_NONBLOCK in ruby/win32.h */ # define MODE_TO_LOAD (O_RDONLY | O_NONBLOCK) -#elif defined O_NDELAY && HAVE_FCNTL && !(O_NDELAY & O_ACCMODE) +#elif defined O_NDELAY && HAVE_FCNTL && !(O_NDELAY & O_ACCMODE) && !defined(__HAIKU__) # define MODE_TO_LOAD (O_RDONLY | O_NDELAY) #else # define MODE_TO_LOAD (O_RDONLY) -- 2.21.0 From e5cc7b856931e82fa5c95578e97464084bff6dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= Date: Sun, 5 May 2019 15:35:20 +0200 Subject: Test fix for Haiku diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb index 4aaa55e..61662cb 100644 --- a/test/fiddle/helper.rb +++ b/test/fiddle/helper.rb @@ -84,6 +84,18 @@ end end end +when /haiku/ + libdir = '/system/lib' + case [0].pack('L!').size + when 4 + # 32-bit ruby + libdir = '/system/lib/x86' if File.directory? '/system/lib/x86' + when 8 + # 64-bit ruby + libdir = '/system/lib/' if File.directory? '/system/lib/' + end + libc_so = File.join(libdir, "libroot.so") + libm_so = File.join(libdir, "libroot.so") else libc_so = ARGV[0] if ARGV[0] && ARGV[0][0] == ?/ libm_so = ARGV[1] if ARGV[1] && ARGV[1][0] == ?/ -- 2.21.0