Commit 462ff4cc authored by Uchio Kondo's avatar Uchio Kondo

Skip socket check on windows

parent 18274e71
...@@ -70,6 +70,7 @@ mkdtemp(char *temp) ...@@ -70,6 +70,7 @@ mkdtemp(char *temp)
int wd_save; int wd_save;
int socket_available_p; int socket_available_p;
#if !defined(_WIN32) && !defined(_WIN64)
static int mrb_io_socket_abailable() static int mrb_io_socket_abailable()
{ {
int fd, retval = 1; int fd, retval = 1;
...@@ -95,6 +96,7 @@ sock_test_out: ...@@ -95,6 +96,7 @@ sock_test_out:
close(fd); close(fd);
return retval; return retval;
} }
#endif
static mrb_value static mrb_value
mrb_io_test_io_setup(mrb_state *mrb, mrb_value self) mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
...@@ -111,7 +113,6 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self) ...@@ -111,7 +113,6 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
#if !defined(_WIN32) && !defined(_WIN64) #if !defined(_WIN32) && !defined(_WIN64)
int fd2, fd3; int fd2, fd3;
struct sockaddr_un sun0; struct sockaddr_un sun0;
#endif
if(!(socket_available_p = mrb_io_socket_abailable())) { if(!(socket_available_p = mrb_io_socket_abailable())) {
char *tmpdir; char *tmpdir;
...@@ -122,6 +123,7 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self) ...@@ -122,6 +123,7 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
else else
assert(!chdir("/tmp")); assert(!chdir("/tmp"));
} }
#endif
mask = umask(077); mask = umask(077);
fd0 = mkstemp(rfname); fd0 = mkstemp(rfname);
...@@ -217,10 +219,12 @@ mrb_io_test_io_cleanup(mrb_state *mrb, mrb_value self) ...@@ -217,10 +219,12 @@ mrb_io_test_io_cleanup(mrb_state *mrb, mrb_value self)
mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_socketname"), mrb_nil_value()); mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_socketname"), mrb_nil_value());
mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_msg"), mrb_nil_value()); mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_msg"), mrb_nil_value());
#if !defined(_WIN32) && !defined(_WIN64)
if(!socket_available_p) { if(!socket_available_p) {
assert(!fchdir(wd_save)); assert(!fchdir(wd_save));
close(wd_save); close(wd_save);
} }
#endif
return mrb_nil_value(); return mrb_nil_value();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment