Mercurial > mplayer.hg
diff gui/ui/gtk/fileselect.c @ 35401:0c93b5400dc7
Check chdir() return value to avoid race condition.
Checking the return value is a good idea anyway.
author | ib |
---|---|
date | Wed, 28 Nov 2012 12:14:46 +0000 |
parents | 4d7adee0a7ba |
children | f42cc2361ee4 |
line wrap: on
line diff
--- 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() );