1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Reverting r18945 for now as using -b breaks things.

Reopening #1886

svn path=/icecast/trunk/icecast/; revision=19100
This commit is contained in:
Thomas B. "dm8tbr" Ruecker 2014-03-01 17:37:38 +00:00
parent b6b01430ef
commit 2cf9930e91

View File

@ -3,11 +3,10 @@
* This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source.
*
* Copyright 2000-2013, Jack Moffitt <jack@xiph.org,
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>,
* Thomas B. Ruecker <thomas.ruecker@tieto.com>
* Karl Heyes <karl@xiph.org>
* and others (see AUTHORS for details).
* Copyright 2011-2012, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
@ -152,40 +151,13 @@ void shutdown_subsystems(void)
static int _parse_config_opts(int argc, char **argv, char *filename, int size)
{
int i;
int i = 1;
int config_ok = 0;
background = 0;
if (argc < 2) return -1;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) {
fprintf(stdout, "%s\n", ICECAST_VERSION_STRING);
exit(0);
}
if (strcmp(argv[i], "-c") == 0) {
if (i + 1 < argc) {
strncpy(filename, argv[i + 1], size-1);
filename[size-1] = 0;
config_ok = 1;
} else {
return -1;
}
}
}
if(config_ok)
return 1;
else
return -1;
}
static int _parse_config_opts_remaining(int argc, char **argv, char *filename, int size)
{
int i;
background = 0;
for (i = 1; i < argc; i++) {
while (i < argc) {
if (strcmp(argv[i], "-b") == 0) {
#ifndef WIN32
pid_t pid;
@ -204,8 +176,27 @@ static int _parse_config_opts_remaining(int argc, char **argv, char *filename, i
background = 1;
#endif
}
if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) {
fprintf(stdout, "%s\n", ICECAST_VERSION_STRING);
exit(0);
}
if (strcmp(argv[i], "-c") == 0) {
if (i + 1 < argc) {
strncpy(filename, argv[i + 1], size-1);
filename[size-1] = 0;
config_ok = 1;
} else {
return -1;
}
}
i++;
}
return 0;
if(config_ok)
return 1;
else
return -1;
}
static int _start_logging(void)
@ -510,9 +501,6 @@ int main(int argc, char **argv)
return 1;
}
/* Delayed command line argument parsing, e.g. background */
_parse_config_opts_remaining(argc, argv, filename, 512);
INFO1 ("%s server started", ICECAST_VERSION_STRING);
/* REM 3D Graphics */