浏览代码

Use a Windows specific socket error code

cypherpunks 8 年之前
父节点
当前提交
596f9a4b4c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/test/test_switch_id.c

+ 4 - 0
src/test/test_switch_id.c

@@ -62,7 +62,11 @@ check_can_bind_low_ports(void)
     } else if (errno == EACCES || errno == EPERM) {
       /* Got a permission-denied error. */
       return 0;
+#if defined(_WIN32)
+    } else if (errno == WSAEADDRINUSE) {
+#else
     } else if (errno == EADDRINUSE) {
+#endif
       /* Huh; somebody is using that port. */
     } else {
       perror("bind");