From 19a700b78b0ff17ef64c85f0e6512112831af900 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Sun, 31 Oct 2004 15:37:54 +0000 Subject: [PATCH] we need to initialize interface_max_connections to 0, to indicate we have no open/possible interfaces for interfacePrintWithFD() (i.e. so we don't get a segfault when creating the db, or other potential problems) git-svn-id: https://svn.musicpd.org/mpd/trunk@2434 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interface.c b/src/interface.c index 4282b89be..72c71f911 100644 --- a/src/interface.c +++ b/src/interface.c @@ -53,7 +53,8 @@ #define INTERFACE_MAX_COMMAND_LIST_DEFAULT (2048*1024) #define INTERFACE_MAX_OUTPUT_BUFFER_SIZE_DEFAULT (2048*1024) -static int interface_max_connections = INTERFACE_MAX_CONNECTIONS_DEFAULT; +/* set this to zero to indicate we have no possible interfaces */ +static int interface_max_connections = 0; /*INTERFACE_MAX_CONNECTIONS_DEFAULT;*/ static int interface_timeout = INTERFACE_TIMEOUT_DEFAULT; static size_t interface_max_command_list_size = INTERFACE_MAX_COMMAND_LIST_DEFAULT; @@ -450,6 +451,7 @@ void initInterfaces() { exit(EXIT_FAILURE); } } + else interface_max_connections = INTERFACE_MAX_CONNECTIONS_DEFAULT; param = getConfigParam(CONF_MAX_COMMAND_LIST_SIZE);