Avoid crash if no JACK command line is specified is rdadmin(1)

This commit is contained in:
Patrick Linstruth 2019-08-19 09:20:53 -07:00
parent 00a18ca23b
commit b07e1e5aa0
2 changed files with 18 additions and 9 deletions

View File

@ -18920,3 +18920,6 @@
on the stack. on the stack.
2019-08-12 Fred Gleason <fredg@paravelsystems.com> 2019-08-12 Fred Gleason <fredg@paravelsystems.com>
* Added 'py-compile' to the 'CLEANFILES' rule in 'Makefile.am'. * Added 'py-compile' to the 'CLEANFILES' rule in 'Makefile.am'.
2019-08-29 Patrick Linstruth <patrick@deltecent.com>
* Modified caed(8) to skip JACK startup, rather than crash, if
no command line is specified in rdadmin(1).

View File

@ -492,18 +492,24 @@ void MainObject::jackInit(RDStation *station)
if(station->startJack()) { if(station->startJack()) {
QStringList args= QStringList args=
station->jackCommandLine().split(" ",QString::SkipEmptyParts); station->jackCommandLine().split(" ",QString::SkipEmptyParts);
QString program=args.at(0); if(args.size()) {
args.removeFirst(); QString program=args.at(0);
QProcess *proc=new QProcess(this); args.removeFirst();
proc->start(program,args); QProcess *proc=new QProcess(this);
if(proc->waitForStarted()) { proc->start(program,args);
RDApplication::syslog(rd_config,LOG_INFO,"JACK server started"); if(proc->waitForStarted()) {
RDApplication::syslog(rd_config,LOG_INFO,"JACK server started");
}
else {
RDApplication::syslog(rd_config,LOG_WARNING,
"failed to start JACK server");
}
sleep(1);
} }
else { else {
RDApplication::syslog(rd_config,LOG_WARNING, RDApplication::syslog(rd_config,LOG_WARNING,
"failed to start JACK server"); "could not start JACK server: no command line specified");
} }
sleep(1);
} }
// //