vlc: return non-zero exit code if starting failed

This commit is contained in:
Rémi Denis-Courmont 2012-11-30 20:29:43 +02:00
parent 405da96034
commit f3a44a5f35
1 changed files with 5 additions and 6 deletions

View File

@ -234,8 +234,9 @@ int main( int i_argc, const char *ppsz_argv[] )
/* Initialize libvlc */
libvlc_instance_t *vlc = libvlc_new (argc, argv);
if (vlc == NULL)
goto out;
return 1;
int ret = 1;
libvlc_set_exit_handler (vlc, vlc_kill, &self);
libvlc_set_user_agent (vlc, "VLC media player", "VLC/"PACKAGE_VERSION);
@ -275,15 +276,13 @@ int main( int i_argc, const char *ppsz_argv[] )
pthread_sigmask (SIG_UNBLOCK, &set, NULL);
alarm (3);
ret = 0;
/* Cleanup */
out:
if (vlc != NULL)
libvlc_release (vlc);
libvlc_release (vlc);
#ifdef __OS2__
for (int i = 2; i < argc; i++)
free (argv[i]);
#endif
return 0;
return ret;
}