Skip to content

Commit f6d47ad

Browse files
committed
tar.gz creating
1 parent 255c717 commit f6d47ad

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CC=gcc
2-
SOURCES=main.c _ping.c
2+
SOURCES=main.c ping.c
33
CFLAGS=-c -Wall
44
LDFLAGS=
55
OBJECTS=$(SOURCES:.c=.o)
@@ -19,4 +19,5 @@ clean:
1919

2020
install:
2121

22-
22+
ping.tar.gz: ping
23+
tar czf ping.tar.gz ping

_ping.c renamed to ping.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ int ping(const char* ip, const ulong timeout, ulong* reply_time)
5757
struct sockaddr_in to_addr;
5858
to_addr.sin_family = AF_INET;
5959
if (!inet_aton(ip, (struct in_addr*)&to_addr.sin_addr.s_addr)) {
60+
printf("inet_aton\n");
6061
return _err_failed;
6162
}
6263

@@ -66,6 +67,7 @@ int ping(const char* ip, const ulong timeout, ulong* reply_time)
6667

6768
const int sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
6869
if (sock < 0) {
70+
printf("socket() %s\n", strerror(errno));
6971
return _err_failed;
7072
}
7173

0 commit comments

Comments
 (0)