Skip to content
Extraits de code Groupes Projets
Vérifiée Valider e71250d3 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

MKV: Warn user when mkvpropedit fails...

parent 386a2113
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!122Resolve "Import the "Favoris" from kurisu"
...@@ -66,14 +66,12 @@ mkvpropedit__(const char *const args[]) ...@@ -66,14 +66,12 @@ mkvpropedit__(const char *const args[])
if ((pid = fork()) == 0) { if ((pid = fork()) == 0) {
if ((fd = open("/dev/null", O_WRONLY | O_TRUNC)) < 0) { if ((fd = open("/dev/null", O_WRONLY | O_TRUNC)) < 0) {
LOG_ERROR("FORK", "Can't to open /dev/null " LOG_ERROR("FORK", "Can't to open /dev/null in O_WRONLY O_TRUNC");
"in O_WRONLY O_TRUNC");
return false; return false;
} }
if (dup2(fd, 1) < 0) { if (dup2(fd, 1) < 0) {
LOG_ERROR("FORK", "Failed to duplicate " LOG_ERROR("FORK", "Failed to duplicate /dev/null to stdout");
"/dev/null to stdout");
return false; return false;
} }
...@@ -89,14 +87,17 @@ mkvpropedit__(const char *const args[]) ...@@ -89,14 +87,17 @@ mkvpropedit__(const char *const args[])
else { else {
do { do {
if (waitpid(pid, &wstatus, WUNTRACED | WCONTINUED) == -1) { if (waitpid(pid, &wstatus, WUNTRACED | WCONTINUED) == -1) {
LOG_ERROR("FORK", "Failed to wait children: %s", LOG_ERROR("FORK", "Failed to wait children: %s", strerror(errno));
strerror(errno));
return false; return false;
} }
} while (!WIFEXITED(wstatus) && !WIFSIGNALED(wstatus)); } while (!WIFEXITED(wstatus) && !WIFSIGNALED(wstatus));
if ((status = WEXITSTATUS(wstatus))) { if ((status = WEXITSTATUS(wstatus))) {
LOG_ERROR("FORK", "Children failed with status %d", status); LOG_ERROR("FORK", "Children failed with status %d", status);
if (status == 2)
LOG_ERROR("FORK", "Status 2 with mkvpropedit could means that karas are not valid MKV files");
else if (status == 1)
LOG_WARN("FORK", "Status 1 on mkvpropedit means that it generated some warnings...");
return false; return false;
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter