]> git.sesse.net Git - vlc/commitdiff
Do not exit with VLC error codes
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 2 Aug 2009 16:54:19 +0000 (19:54 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 2 Aug 2009 16:54:19 +0000 (19:54 +0300)
exit() cannot return negative numbers (the high-order bits are ignored).
And anyway, that's not a meanigful place for VLC error codes. It is also
questionable whether we should exit() from LibVLC anyway...

src/libvlc.c

index 415d9d9f716ca3566957e5a8e8589be04e31e6e0..decd51f7532676044c9220f9d413258be8e8cfcc 100644 (file)
@@ -641,7 +641,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
                     {
                         msg_Err( p_libvlc, "D-Bus problem" );
                         system_End( p_libvlc );
-                        exit( VLC_ETIMEOUT );
+                        exit( 1 );
                     }
 
                     /* append MRLs */
@@ -651,7 +651,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
                     {
                         dbus_message_unref( p_dbus_msg );
                         system_End( p_libvlc );
-                        exit( VLC_ENOMEM );
+                        exit( 1 );
                     }
                     b_play = TRUE;
                     if( config_GetInt( p_libvlc, "playlist-enqueue" ) > 0 )
@@ -661,7 +661,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
                     {
                         dbus_message_unref( p_dbus_msg );
                         system_End( p_libvlc );
-                        exit( VLC_ENOMEM );
+                        exit( 1 );
                     }
 
                     /* send message and get a handle for a reply */
@@ -671,7 +671,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
                         msg_Err( p_libvlc, "D-Bus problem" );
                         dbus_message_unref( p_dbus_msg );
                         system_End( p_libvlc );
-                        exit( VLC_ETIMEOUT );
+                        exit( 1 );
                     }
 
                     if ( NULL == p_dbus_pending )
@@ -679,7 +679,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
                         msg_Err( p_libvlc, "D-Bus problem" );
                         dbus_message_unref( p_dbus_msg );
                         system_End( p_libvlc );
-                        exit( VLC_ETIMEOUT );
+                        exit( 1 );
                     }
                     dbus_connection_flush( p_conn );
                     dbus_message_unref( p_dbus_msg );
@@ -690,7 +690,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
 
                 /* bye bye */
                 system_End( p_libvlc );
-                exit( VLC_SUCCESS );
+                exit( 0 );
             }
         }
         /* we unreference the connection when we've finished with it */