Commit 31abf7f6 authored by Conrad Parker's avatar Conrad Parker

ensure the return value of ogg123 is always usable; make sure to return a

failure if an error has been flagged. Closes ticket:447 and debian bug #193349

svn path=/trunk/vorbis-tools/; revision=10091
parent 112fadc1
......@@ -46,6 +46,7 @@
#include "ogg123.h"
#include "i18n.h"
extern int exit_status; /* from status.c */
void exit_cleanup ();
void play (char *source_string);
......@@ -402,10 +403,9 @@ int main(int argc, char **argv)
playlist_array_destroy(playlist_array, items);
exit (0);
exit (exit_status);
}
void play (char *source_string)
{
transport_t *transport;
......@@ -621,7 +621,7 @@ void play (char *source_string)
status_message(1, _("Done."));
if (sig_request.exit)
exit (0);
exit (exit_status);
}
......
......@@ -25,6 +25,7 @@
char temp_buffer[200];
int last_line_len = 0;
int max_verbosity = 0;
int exit_status = EXIT_SUCCESS;
pthread_mutex_t output_lock = PTHREAD_MUTEX_INITIALIZER;
......@@ -449,6 +450,8 @@ void status_error (const char *fmt, ...)
pthread_mutex_unlock(&output_lock);
pthread_cleanup_pop(0);
exit_status = EXIT_FAILURE;
}
......@@ -462,4 +465,6 @@ void vstatus_error (const char *fmt, va_list ap)
pthread_mutex_unlock(&output_lock);
pthread_cleanup_pop(0);
exit_status = EXIT_FAILURE;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment