X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FTCP_cunc_daytimed.c;h=32f38c7c61b194b4aafc22ed638521ed2e33c45f;hp=5be9d2343a23451d7a6a212af5b481d1c747acf9;hb=04c68576a3be5ccfda8faf2030d4cbc2997c29fa;hpb=d47f15496fa85c8ec22edcde608f2665ec5b95ae diff --git a/sources/TCP_cunc_daytimed.c b/sources/TCP_cunc_daytimed.c index 5be9d23..32f38c7 100644 --- a/sources/TCP_cunc_daytimed.c +++ b/sources/TCP_cunc_daytimed.c @@ -26,18 +26,18 @@ * * Usage: daytimed -h give all info * - * $Id: TCP_cunc_daytimed.c,v 1.1 2003/04/29 15:33:39 piccardi Exp $ - * ****************************************************************/ /* * Include needed headers */ -#include /* predefined types */ -#include /* include unix standard library */ -#include /* IP addresses conversion utiliites */ -#include /* socket library */ -#include /* include standard I/O library */ -#include +#include /* primitive system data types */ +#include /* unix standard library */ +#include /* IP addresses conversion utilities */ +#include /* socket constants, types and functions */ +#include /* standard I/O library */ +#include /* date and time constants, types and functions */ +#include /* C strings library */ +#include /* C standard library */ #define MAXLINE 80 #define BACKLOG 10 @@ -113,8 +113,9 @@ int main(int argc, char *argv[]) } /* write daytime to client */ while (1) { - if ( (conn_fd = accept(list_fd, (struct sockaddr *)&client, &len)) - <0 ) { + len = sizeof(client); + if ( (conn_fd = + accept(list_fd, (struct sockaddr *)&client, &len)) <0 ) { perror("accept error"); exit(-1); }