Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ssuks] Make ssuks exit cleanly on errors
  • Loading branch information
Bernd Wachter committed May 27, 2013
1 parent b28af35 commit ce26c0f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ssuks/ssuks.cpp
Expand Up @@ -25,6 +25,7 @@ void SsuKs::run(){
arguments.removeFirst();

QTextStream qout(stdout);
QTextStream qerr(stderr);
QHash<QString, QString> repoParameters;

QString fileName;
Expand All @@ -37,6 +38,7 @@ void SsuKs::run(){
for (int i=0; i<arguments.count(); i++){
if (arguments.at(i).count("=") != 1){
qout << "Invalid flag: " << arguments.at(i) << endl;
QCoreApplication::exit(1);
return;
}
QStringList split = arguments.at(i).split("=");
Expand All @@ -52,14 +54,14 @@ void SsuKs::run(){
sb = new Sandbox(sandbox, Sandbox::UseDirectly, Sandbox::ThisProcess);

if (!sb->addWorldFiles(SSU_DATA_DIR)){
qout << "Failed to copy files into sandbox" << endl;
return;
qerr << "Failed to copy files into sandbox, using empty sandbox" << endl;
}

if (sb->activate())
qout << "Using sandbox at " << sandbox << endl;
qerr << "Using sandbox at " << sandbox << endl;
else {
qout << "Failed to activate sandbox" << endl;
qerr << "Failed to activate sandbox" << endl;
QCoreApplication::exit(1);
return;
}

Expand Down

0 comments on commit ce26c0f

Please sign in to comment.