--- libaitio/example/recvfile.c 2011/12/13 02:23:07 1.2 +++ libaitio/example/recvfile.c 2016/08/18 09:06:31 1.4 @@ -1,7 +1,9 @@ #include +#include #include #include #include +#include #include @@ -15,8 +17,10 @@ main(int argc, char **argv) if (argc < 3) return 1; +#ifndef __linux__ sa.sa_len = sl = sizeof sa; sin.sin_len = sizeof sin; +#endif sin.sin_family = AF_INET; sin.sin_port = htons(5000); sin.sin_addr.s_addr = inet_addr("127.0.0.1"); @@ -37,8 +41,9 @@ main(int argc, char **argv) return 4; } - if ((c = accept(s, &sa, &sl)) != -1) { - sl = ioRecvFile(c, argv[1], strtol(argv[2], NULL, 0), 0644, argv[3] ? strtol(argv[3], NULL, 0) : 0); + if ((c = accept(s, &sa, (socklen_t*) &sl)) != -1) { + sl = ioRecvFile(c, argv[1], strtol(argv[2], NULL, 0), 0644, + argv[3] ? strtol(argv[3], NULL, 0) : 0); printf("received %d bytes\n", sl); if (!sl) printf("#%d - %s\n", io_GetErrno(), io_GetError());