* Require absolute filename for pidfile. (Thanks Andrea Biardi)

This commit is contained in:
Justin Maggard 2012-02-23 06:12:58 +00:00
parent ef7f537bee
commit aea5da4107

View File

@ -644,7 +644,12 @@ init(int argc, char * * argv)
break; break;
case 'P': case 'P':
if(i+1 < argc) if(i+1 < argc)
pidfilename = argv[++i]; {
if (argv[++i][0] != '/')
DPRINTF(E_FATAL, L_GENERAL, "Option -%c requires an absolute filename.\n", argv[i-1][1]);
else
pidfilename = argv[i];
}
else else
DPRINTF(E_ERROR, L_GENERAL, "Option -%c takes one argument.\n", argv[i][1]); DPRINTF(E_ERROR, L_GENERAL, "Option -%c takes one argument.\n", argv[i][1]);
break; break;