Skip to content

Commit 28d913c

Browse files
committed
使用 xy.os_devnull
1 parent 9031591 commit 28d913c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/xy.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ bool xy_on_macos = false;
6464
bool xy_on_bsd = false;
6565
bool xy_on_android = false;
6666

67-
char *xy_os_devnull = NULL;
6867

6968
/* 全局变量 与 全局状态 */
7069
struct
@@ -1222,9 +1221,9 @@ xy_init ()
12221221
xy_detect_os ();
12231222

12241223
if (xy_on_windows)
1225-
xy_os_devnull = "nul";
1224+
xy.os_devnull = "nul";
12261225
else
1227-
xy_os_devnull = "/dev/null";
1226+
xy.os_devnull = "/dev/null";
12281227

12291228
xy_use_utf8 ();
12301229
}

src/framework/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ measure_speed_for_url (void *url)
640640
ipv6 = "--ipv6";
641641
}
642642

643-
char *os_devnull = xy_os_devnull;
643+
char *os_devnull = xy.os_devnull;
644644

645645
/**
646646
* @note 我们用 —L,因为部分链接会跳转到其他地方,比如: RubyChina, npmmirror

0 commit comments

Comments
 (0)