# HG changeset patch # User ib # Date 1354104886 0 # Node ID 0c93b5400dc7604840f21b6002a109785f98caaf # Parent 074069bb765a2af9e239a61a87810040fd2ffe79 Check chdir() return value to avoid race condition. Checking the return value is a good idea anyway. diff -r 074069bb765a -r 0c93b5400dc7 gui/ui/gtk/fileselect.c --- a/gui/ui/gtk/fileselect.c Wed Nov 28 11:57:52 2012 +0000 +++ b/gui/ui/gtk/fileselect.c Wed Nov 28 12:14:46 2012 +0000 @@ -489,7 +489,7 @@ 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() );