Now the tcp_server handles well the situation where there isn't a log file.
authorviric@llimona
Tue, 30 May 2006 12:57:31 +0200
changeset 58 c03287b2c3c1
parent 57 de776a4548da
child 59 a8776c046a53
Now the tcp_server handles well the situation where there isn't a log file.
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)