[MPlayer-cvslog] r35495 - trunk/gui/ui/gtk/fileselect.c

ib subversion at mplayerhq.hu
Wed Nov 28 13:14:46 CET 2012


Author: ib
Date: Wed Nov 28 13:14:46 2012
New Revision: 35495

Log:
Check chdir() return value to avoid race condition.

Checking the return value is a good idea anyway.

Modified:
   trunk/gui/ui/gtk/fileselect.c

Modified: trunk/gui/ui/gtk/fileselect.c
==============================================================================
--- trunk/gui/ui/gtk/fileselect.c	Wed Nov 28 12:57:52 2012	(r35494)
+++ trunk/gui/ui/gtk/fileselect.c	Wed Nov 28 13:14:46 2012	(r35495)
@@ -489,7 +489,7 @@ static void fs_Ok_released( GtkButton * 
 
  if( ( stat( fsSelectedFile,&fs ) == 0 ) && S_ISDIR( fs.st_mode ) )
   {
-   chdir( fsSelectedFile );
+   if ( chdir( fsSelectedFile ) != 0 ) return;
    fsSelectedFile=fsThatDir;
    CheckDir( fsFNameList );
    gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() );


More information about the MPlayer-cvslog mailing list