diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-15 18:17:43 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-20 17:51:15 +1000 |
commit | 7dc41624d037b85b8498c3a679415a74e00b90cf (patch) | |
tree | 8fc57e4f5d75a0069b200f4f2a4d2d6fc5582b44 | |
parent | 47915c865a0874420efcb4c624b0569d21df528e (diff) | |
download | busybox-w32-7dc41624d037b85b8498c3a679415a74e00b90cf.tar.gz busybox-w32-7dc41624d037b85b8498c3a679415a74e00b90cf.tar.bz2 busybox-w32-7dc41624d037b85b8498c3a679415a74e00b90cf.zip |
win32: implement inet_aton()
-rw-r--r-- | include/mingw.h | 1 | ||||
-rw-r--r-- | win32/Kbuild | 1 | ||||
-rw-r--r-- | win32/net.c | 11 |
3 files changed, 13 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h index 53a0a0d67..d61d87bf3 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -15,6 +15,7 @@ typedef int pid_t; | |||
15 | */ | 15 | */ |
16 | static inline unsigned int git_ntohl(unsigned int x) { return (unsigned int)ntohl(x); } | 16 | static inline unsigned int git_ntohl(unsigned int x) { return (unsigned int)ntohl(x); } |
17 | #define ntohl git_ntohl | 17 | #define ntohl git_ntohl |
18 | int inet_aton(const char *cp, struct in_addr *inp); | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * fcntl.h | 21 | * fcntl.h |
diff --git a/win32/Kbuild b/win32/Kbuild index a4a7f32d4..bc005c23a 100644 --- a/win32/Kbuild +++ b/win32/Kbuild | |||
@@ -9,5 +9,6 @@ lib-$(CONFIG_PLATFORM_MINGW32) += fnmatch.o | |||
9 | lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o | 9 | lib-$(CONFIG_PLATFORM_MINGW32) += mingw.o |
10 | lib-$(CONFIG_PLATFORM_MINGW32) += process.o | 10 | lib-$(CONFIG_PLATFORM_MINGW32) += process.o |
11 | lib-$(CONFIG_PLATFORM_MINGW32) += regex.o | 11 | lib-$(CONFIG_PLATFORM_MINGW32) += regex.o |
12 | lib-$(CONFIG_WIN32_NET) += net.o | ||
12 | lib-$(CONFIG_PLATFORM_MINGW32) += termios.o | 13 | lib-$(CONFIG_PLATFORM_MINGW32) += termios.o |
13 | lib-$(CONFIG_PLATFORM_MINGW32) += winansi.o | 14 | lib-$(CONFIG_PLATFORM_MINGW32) += winansi.o |
diff --git a/win32/net.c b/win32/net.c new file mode 100644 index 000000000..93e19ae5c --- /dev/null +++ b/win32/net.c | |||
@@ -0,0 +1,11 @@ | |||
1 | #include "libbb.h" | ||
2 | |||
3 | int inet_aton(const char *cp, struct in_addr *inp) | ||
4 | { | ||
5 | unsigned long val = inet_addr(cp); | ||
6 | |||
7 | if (val == INADDR_NONE) | ||
8 | return 0; | ||
9 | inp->S_un.S_addr = val; | ||
10 | return 1; | ||
11 | } | ||