Ticket #9194: mythfilldatabase.exit-status.diff
File mythfilldatabase.exit-status.diff, 2.5 KB (added by , 13 years ago) |
---|
-
filldata.cpp
430 430 431 431 QByteArray tmp = command.toAscii(); 432 432 int systemcall_status = system(tmp.constData()); 433 bool succeeded = WIFEXITED(systemcall_status) &&434 WEXITSTATUS(systemcall_status) == 0;435 433 436 434 VERBOSE(VB_XMLTV, 437 435 "------------------ End of XMLTV output ------------------"); 438 436 439 437 updateLastRunEnd(query); 440 438 441 status = QObject::tr("Successful.");442 443 if ( !succeeded)439 bool succeeded = false; 440 441 if (WIFEXITED(systemcall_status)) 444 442 { 445 if (WIFSIGNALED(systemcall_status) && 446 (WTERMSIG(systemcall_status) == SIGINT 447 || WTERMSIG(systemcall_status) == SIGQUIT)) 443 if (WEXITSTATUS(systemcall_status) == 0) 448 444 { 449 interrupted = true;450 status = Q String(QObject::tr("FAILED: xmltv ran but was interrupted."));445 succeeded = true; 446 status = QObject::tr("Successful."); 451 447 } 452 448 else 453 449 { 454 status = QString(QObject::tr("FAILED: xmltv returned error code %1.")) 455 .arg(systemcall_status); 456 VERBOSE(VB_IMPORTANT, LOC_ERR + 457 QString("xmltv returned error code %1") 458 .arg(systemcall_status)); 450 status = QObject::tr("xmltv exited with non-zero exit status %1.") 451 .arg(WEXITSTATUS(systemcall_status)); 459 452 } 460 453 } 454 else if (WIFSIGNALED(systemcall_status)) 455 { 456 if (WTERMSIG(systemcall_status) == SIGINT 457 || WTERMSIG(systemcall_status) == SIGQUIT) 458 { 459 interrupted = true; 460 status = QObject::tr("xmltv ran but was interrupted."); 461 } 462 else 463 { 464 status = QObject::tr("xmltv killed by signal %1.") 465 .arg(WTERMSIG(systemcall_status)); 466 } 467 } 468 else 469 { // cannot parse the status; this shouldn't happen 470 status = QObject::tr("xmltv exited with termination status %1.") 471 .arg(systemcall_status); 472 } 473 474 if (WCOREDUMP(systemcall_status)) 475 { 476 status += QObject::tr(" (Core dumped.)"); 477 } 461 478 479 if (!succeeded) 480 { 481 if (!interrupted) 482 { 483 VERBOSE(VB_IMPORTANT, LOC_ERR + status); 484 } 485 status.prepend(QObject::tr("FAILED: ")); 486 } 487 462 488 updateLastRunStatus(query, status); 463 489 464 490 succeeded &= GrabDataFromFile(source.id, filename);