diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index e6f6320b86..95842c7743 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -81,7 +81,10 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog) { // Use chdir to not care about filename encodings wxGtkString folder(g_path_get_dirname(filename)); - chdir(folder); + if ( chdir(folder) != 0 ) + { + wxLogSysError(_("Changing current directory to \"%s\" failed")); + } } wxCommandEvent event(wxEVT_BUTTON, wxID_OK); diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 3abea8d7cf..b3d777da3e 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -180,7 +180,12 @@ static void file_set(GtkFileChooser* widget, wxDirButton* p) // thus we need to make sure the current working directory is updated if wxDIRP_CHANGE_DIR // style was given. if (p->HasFlag(wxDIRP_CHANGE_DIR)) - chdir(filename); + { + if ( chdir(filename) != 0 ) + { + wxLogSysError(_("Changing current directory to \"%s\" failed")); + } + } // ...and fire an event wxFileDirPickerEvent event(wxEVT_DIRPICKER_CHANGED, p, p->GetId(), p->GetPath());