Subversion Repositories mdb

Rev

Rev 28 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 34
Line 1... Line 1...
1
/*
1
/*
2
 * Copyright (C) 2015 by Andreas Theofilu <andreas@theosys.at>
2
 * Copyright (C) 2015, 2016 by Andreas Theofilu <andreas@theosys.at>
3
 *
3
 *
4
 * All rights reserved. No warranty, explicit or implicit, provided.
4
 * All rights reserved. No warranty, explicit or implicit, provided.
5
 *
5
 *
6
 * NOTICE:  All information contained herein is, and remains
6
 * NOTICE:  All information contained herein is, and remains
7
 * the property of Andreas Theofilu and his suppliers, if any.
7
 * the property of Andreas Theofilu and his suppliers, if any.
Line 66... Line 66...
66
	strcpy(configs.Grp,"nobody");
66
	strcpy(configs.Grp,"nobody");
67
	strcpy(configs.Pidfile, "/var/run/mdb.pid");
67
	strcpy(configs.Pidfile, "/var/run/mdb.pid");
68
	strcpy(configs.home, "/var/lib/mdb");
68
	strcpy(configs.home, "/var/lib/mdb");
69
	strcpy(configs.player, "/usr/lib/mpg321");
69
	strcpy(configs.player, "/usr/lib/mpg321");
70
	configs.port = 11003;
70
	configs.port = 11003;
-
 
71
	configs.debug = 0;
71
	
72
	
72
	if (!confFile[0] || (fd = open(confFile, O_RDONLY)) == -1)
73
	if (!confFile[0] || (fd = open(confFile, O_RDONLY)) == -1)
73
	{
74
	{
74
		if (confFile[0])
75
		if (confFile[0])
75
			syslog(LOG_WARNING,"Error opening the config file %s! Using built in defaults. (%s)", confFile, strerror(errno));
76
			syslog(LOG_WARNING,"Error opening the config file %s! Using built in defaults. (%s)", confFile, strerror(errno));
Line 143... Line 144...
143
		else if (!strcasecmp(hv0, "OutPlayer"))
144
		else if (!strcasecmp(hv0, "OutPlayer"))
144
		{
145
		{
145
			syslog(LOG_INFO,"Found \"OutPlayer\": %s", hv1);
146
			syslog(LOG_INFO,"Found \"OutPlayer\": %s", hv1);
146
			strncpy (configs.player, hv1, sizeof(configs.player));
147
			strncpy (configs.player, hv1, sizeof(configs.player));
147
		}
148
		}
-
 
149
		else if (!strcasecmp(hv0, "Debug"))
-
 
150
		{
-
 
151
			syslog(LOG_INFO,"Found \"Debug\": %s", hv1);
-
 
152
 
-
 
153
			if (!strcasecmp(hv1, "1") || !strcasecmp(hv1, "true") || !strcasecmp(hv1, "yes"))
-
 
154
			{
-
 
155
				configs.debug = 1;
-
 
156
				syslog(LOG_DEBUG, "Debugging is activated");
-
 
157
			}
-
 
158
		}
148
	}
159
	}
149
 
160
 
-
 
161
	if (!configs.debug)
-
 
162
		syslog(LOG_DEBUG, "Debugging is deactivated");
-
 
163
 
150
	close (fd);
164
	close (fd);
151
}
165
}