Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamierymenko committed May 9, 2017
1 parent a9a8da8 commit 123e718
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions catch.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ int main(int argc,char **argv)
#if defined(_WIN32) || defined(_WIN64)
WSADATA wsaData;
WSAStartup(MAKEWORD(2,2),&wsaData);
#else
signal(SIGALRM,catch_sigalrm);
#endif

if ((argc < 2)||(argc > 3)) {
Expand Down Expand Up @@ -150,7 +148,13 @@ int main(int argc,char **argv)
}
#endif

#if defined(_WIN32) || defined(_WIN64)
#error No timeout implementation for Windows yet.
#else
signal(SIGALRM,catch_sigalrm);
alarm(TRY_SCOPE_TIMEOUT[k]);
#endif

if (connect(csock,(struct sockaddr *)&sa,(sa.ss_family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6))) {
alarm(0);
close(csock);
Expand Down

0 comments on commit 123e718

Please sign in to comment.