From 16b73c1f390fcf3b72f516971bbc610dfb23722d Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Mon, 13 May 2002 17:12:45 +0000 Subject: [PATCH] * editcmd.c (edit_save_file): Call mc_chown () and mc_chmod () before mc_open () to prevent hangs over ftpfs. --- edit/ChangeLog | 3 +++ edit/editcmd.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/edit/ChangeLog b/edit/ChangeLog index 10e6bdfca..3ecb4170f 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,5 +1,8 @@ 2002-05-13 Andrew V. Samoilov + * editcmd.c (edit_save_file): Call mc_chown () and mc_chmod () + before mc_open () to prevent hangs over ftpfs. + * edit.h: Remove open, close, write, read and mkdir declaration. * edit.c: Use mc_open, mc_close, mc_write, mc_read, mc_rename, mc_chmod and mc_chown. Don't cast (char *) to (unsigned long) diff --git a/edit/editcmd.c b/edit/editcmd.c index b446fd4ed..dd6dd5b1d 100644 --- a/edit/editcmd.c +++ b/edit/editcmd.c @@ -222,13 +222,13 @@ int edit_save_file (WEdit * edit, const char *filename) } else savename = g_strdup (filename); + mc_chmod (savename, edit->stat1.st_mode); + mc_chown (savename, edit->stat1.st_uid, edit->stat1.st_gid); + if ((fd = mc_open (savename, O_CREAT | O_WRONLY | O_TRUNC | MY_O_TEXT, edit->stat1.st_mode)) == -1) goto error_save; - mc_chmod (savename, edit->stat1.st_mode); - mc_chown (savename, edit->stat1.st_uid, edit->stat1.st_gid); - /* pipe save */ if ((p = (char *) edit_get_write_filter (savename, filename))) { FILE *file;