Skip to content

Commit

Permalink
tar.gz creating
Browse files Browse the repository at this point in the history
  • Loading branch information
a-khakimov committed Jul 20, 2020
1 parent 255c717 commit f6d47ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CC=gcc
SOURCES=main.c _ping.c
SOURCES=main.c ping.c
CFLAGS=-c -Wall
LDFLAGS=
OBJECTS=$(SOURCES:.c=.o)
Expand All @@ -19,4 +19,5 @@ clean:

install:


ping.tar.gz: ping
tar czf ping.tar.gz ping
2 changes: 2 additions & 0 deletions _ping.c → ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ int ping(const char* ip, const ulong timeout, ulong* reply_time)
struct sockaddr_in to_addr;
to_addr.sin_family = AF_INET;
if (!inet_aton(ip, (struct in_addr*)&to_addr.sin_addr.s_addr)) {
printf("inet_aton\n");
return _err_failed;
}

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

const int sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
if (sock < 0) {
printf("socket() %s\n", strerror(errno));
return _err_failed;
}

Expand Down

0 comments on commit f6d47ad

Please sign in to comment.