Commit f3a44a5f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vlc: return non-zero exit code if starting failed

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