Commit 18274e71 authored by Uchio Kondo's avatar Uchio Kondo

Follow C90 style

parent 7870f74c
...@@ -99,16 +99,6 @@ sock_test_out: ...@@ -99,16 +99,6 @@ sock_test_out:
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)
{ {
if(!(socket_available_p = mrb_io_socket_abailable())) {
char *tmpdir;
wd_save = open(".", O_DIRECTORY);
tmpdir = getenv("TMPDIR");
if (tmpdir)
assert(!chdir(tmpdir));
else
assert(!chdir("/tmp"));
}
char rfname[] = "tmp.mruby-io-test-r.XXXXXXXX"; char rfname[] = "tmp.mruby-io-test-r.XXXXXXXX";
char wfname[] = "tmp.mruby-io-test-w.XXXXXXXX"; char wfname[] = "tmp.mruby-io-test-w.XXXXXXXX";
char symlinkname[] = "tmp.mruby-io-test-l.XXXXXXXX"; char symlinkname[] = "tmp.mruby-io-test-l.XXXXXXXX";
...@@ -123,6 +113,16 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self) ...@@ -123,6 +113,16 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
struct sockaddr_un sun0; struct sockaddr_un sun0;
#endif #endif
if(!(socket_available_p = mrb_io_socket_abailable())) {
char *tmpdir;
wd_save = open(".", O_DIRECTORY);
tmpdir = getenv("TMPDIR");
if (tmpdir)
assert(!chdir(tmpdir));
else
assert(!chdir("/tmp"));
}
mask = umask(077); mask = umask(077);
fd0 = mkstemp(rfname); fd0 = mkstemp(rfname);
fd1 = mkstemp(wfname); fd1 = mkstemp(wfname);
......
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