Subversion Repositories mdb

Rev

Rev 4 | Rev 28 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 5
Line 63... Line 63...
63
 
63
 
64
	memset(&configs, 0, sizeof(configs));
64
	memset(&configs, 0, sizeof(configs));
65
	strcpy(configs.User,"nobody");
65
	strcpy(configs.User,"nobody");
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, home);			/* In this directory the database is */
68
	strcpy(configs.home, "/var/lib/mdb");
69
	strcat(configs.home, "/.mdb");		/* stored. */
69
	strcpy(configs.player, "/usr/lib/mpg321");
70
	configs.port = 11003;
70
	configs.port = 11003;
71
	
71
	
72
	if (!confFile[0] || (fd = open(confFile, O_RDONLY)) == -1)
72
	if (!confFile[0] || (fd = open(confFile, O_RDONLY)) == -1)
73
	{
73
	{
74
		if (confFile[0])
74
		if (confFile[0])
Line 133... Line 133...
133
		else if (!strcasecmp(hv0, "Musicfile"))
133
		else if (!strcasecmp(hv0, "Musicfile"))
134
		{
134
		{
135
			syslog(LOG_INFO,"Found \"Musicfile\": %s", hv1);
135
			syslog(LOG_INFO,"Found \"Musicfile\": %s", hv1);
136
			strncpy (configs.Pathfile, hv1, sizeof(configs.Pathfile));
136
			strncpy (configs.Pathfile, hv1, sizeof(configs.Pathfile));
137
		}
137
		}
-
 
138
		else if (!strcasecmp(hv0, "Database"))
-
 
139
		{
-
 
140
			syslog(LOG_INFO,"Found \"Database\": %s", hv1);
-
 
141
			strncpy (configs.home, hv1, sizeof(configs.home));
-
 
142
		}
-
 
143
		else if (!strcasecmp(hv0, "mp3player"))
-
 
144
		{
-
 
145
			syslog(LOG_INFO,"Found \"MP3player\": %s", hv1);
-
 
146
			strncpy (configs.player, hv1, sizeof(configs.player));
-
 
147
		}
138
	}
148
	}
139
 
149
 
140
	close (fd);
150
	close (fd);
141
}
151
}