Commit 777cf70c authored by Eric Hodel's avatar Eric Hodel

Include reason in test failure message

I am seeing this test fail in some environments but can't determine why.
The extra information will help me determine the reason bind(2) is
failing.
parent 1c442888
#include <sys/types.h>
#include <errno.h>
#if defined(_WIN32) || defined(_WIN64)
#include <winsock.h>
......@@ -84,7 +85,9 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self)
sun0.sun_family = AF_UNIX;
snprintf(sun0.sun_path, sizeof(sun0.sun_path), "%s", socketname);
if (bind(fd3, (struct sockaddr *)&sun0, sizeof(sun0)) == -1) {
mrb_raise(mrb, E_RUNTIME_ERROR, "can't make a socket bi");
mrb_raisef(mrb, E_RUNTIME_ERROR, "can't bind AF_UNIX socket to %S: %S",
mrb_str_new_cstr(mrb, sun0.sun_path),
mrb_fixnum_value(errno));
}
close(fd3);
#endif
......
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