about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--ext/kgio/connect.c2
-rw-r--r--ext/kgio/sock_for_fd.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/kgio/connect.c b/ext/kgio/connect.c
index 4e46704..9642429 100644
--- a/ext/kgio/connect.c
+++ b/ext/kgio/connect.c
@@ -119,7 +119,7 @@ static VALUE unix_connect(VALUE klass, VALUE path, int io_wait)
 
         StringValue(path);
         len = RSTRING_LEN(path);
-        if (sizeof(addr.sun_path) <= len)
+        if ((long)sizeof(addr.sun_path) <= len)
                 rb_raise(rb_eArgError,
                          "too long unix socket path (max: %dbytes)",
                          (int)sizeof(addr.sun_path)-1);
diff --git a/ext/kgio/sock_for_fd.h b/ext/kgio/sock_for_fd.h
index ab704b1..52947d9 100644
--- a/ext/kgio/sock_for_fd.h
+++ b/ext/kgio/sock_for_fd.h
@@ -64,6 +64,6 @@ static void init_sock_for_fd(void)
 }
 #endif /* sock_for_fd */
 #if SOCK_FOR_FD > 0
-#  define init_sock_for_fd() if (0)
+#  define init_sock_for_fd() for (;0;)
 #endif
 #endif /* SOCK_FOR_FD_H */