# HG changeset patch # User viric@llimona # Date 1148986651 -7200 # Node ID c03287b2c3c13fd26825e38afb119e8dd215452d # Parent de776a4548da86e492093c634127d20c1c76e49c Now the tcp_server handles well the situation where there isn't a log file. diff -r de776a4548da -r c03287b2c3c1 tcp_server.c --- a/tcp_server.c Tue May 30 12:34:25 2006 +0200 +++ b/tcp_server.c Tue May 30 12:57:31 2006 +0200 @@ -298,7 +298,20 @@ char *buffer2; char name[MAX_STRING]; - assert (get_config(LOG_FILE, name, MAX_STRING) > 0); + if (get_config(LOG_FILE, name, MAX_STRING) < 0) + { + fprintf(stderr, "The tcp_server received a connection, but" + " there isn't any log file."); + return -1; + } + + if (strncmp(name, "disabled", MAX_STRING) == 0) + { + fprintf(stderr, "The tcp_server received a connection, but" + " there isn't any log file."); + return -1; + } + fh = open(name, O_RDONLY); if (fh == -1)