X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FTCP_echod.c;fp=sources%2FTCP_echod.c;h=83d0c738f294743dd66478dfcb9b17d0e0bc7548;hp=049155744c919942c335a3a5f3b818ce0005990f;hb=49ae2790472cc2ad1e54ea26d037306598f9c83b;hpb=a0baefcdc1505ecb62f6336acef1153bb56eaf73 diff --git a/sources/TCP_echod.c b/sources/TCP_echod.c index 0491557..83d0c73 100644 --- a/sources/TCP_echod.c +++ b/sources/TCP_echod.c @@ -26,7 +26,7 @@ * * Usage: echod -h give all info * - * $Id: TCP_echod.c,v 1.8 2003/07/27 14:28:19 piccardi Exp $ + * $Id: TCP_echod.c,v 1.9 2003/07/27 23:41:04 piccardi Exp $ * ****************************************************************/ /* @@ -41,7 +41,7 @@ #include /* syslog system functions */ #include /* signal functions */ #include /* error code */ -#include /* error code */ +#include /* error strings */ #include "Gapil.h" #define BACKLOG 10 @@ -209,7 +209,7 @@ void ServEcho(int sockfd) { } } nwrite = FullWrite(sockfd, buffer, nread); - if (nwrite < 0) { + if (nwrite) { snprintf(debug, MAXLINE+20, "Errore in scrittura: %s \n", strerror(errno)); if (demonize) { /* daemon mode */ @@ -234,8 +234,8 @@ void ServEcho(int sockfd) { * routine to print error on stout or syslog */ void PrintErr(char * error) { - if (demonize) { /* daemon mode */ - syslog(LOG_ERR, error); + if (demonize) { /* daemon mode */ + syslog(LOG_ERR, "%s: %m", error); /* log string and error message */ } else { perror(error); }