mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-22 03:02:06 +03:00
Use events to show VFS messages.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
746653fda2
commit
5a458c702d
@ -26,6 +26,15 @@ typedef struct
|
||||
gboolean ret;
|
||||
} ev_vfs_stamp_create_t;
|
||||
|
||||
|
||||
/* MCEVENT_GROUP_CORE:vfs_print_message */
|
||||
typedef struct
|
||||
{
|
||||
const char *msg;
|
||||
va_list ap;
|
||||
} ev_vfs_print_message_t;
|
||||
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
||||
/*** declarations of public functions ************************************************************/
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <time.h>
|
||||
#include <sys/time.h> /* gettimeofday() */
|
||||
#include <inttypes.h> /* uintmax_t */
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
|
||||
@ -45,8 +46,6 @@
|
||||
#include "lib/widget.h" /* message() */
|
||||
#endif
|
||||
|
||||
#include "src/filemanager/layout.h" /* print_vfs_message */
|
||||
|
||||
#include "vfs.h"
|
||||
#include "utilvfs.h"
|
||||
#include "xdirentry.h"
|
||||
@ -279,7 +278,7 @@ vfs_s_find_entry_linear (struct vfs_class *me, struct vfs_s_inode *root,
|
||||
if (ent && (!(MEDATA->dir_uptodate) (me, ent->ino)))
|
||||
{
|
||||
#if 1
|
||||
print_vfs_message (_("Directory cache expired for %s"), path);
|
||||
vfs_print_message (_("Directory cache expired for %s"), path);
|
||||
#endif
|
||||
vfs_s_free_entry (me, ent);
|
||||
ent = NULL;
|
||||
@ -708,11 +707,11 @@ vfs_s_print_stats (const char *fs_name, const char *action,
|
||||
}
|
||||
|
||||
if (need)
|
||||
print_vfs_message (i18n_percent_transf_format, fs_name, action,
|
||||
vfs_print_message (i18n_percent_transf_format, fs_name, action,
|
||||
file_name, (int) ((double) have * 100 / need), (uintmax_t) have,
|
||||
_("bytes transferred"));
|
||||
else
|
||||
print_vfs_message (i18n_transf_format, fs_name, action, file_name, (uintmax_t) have,
|
||||
vfs_print_message (i18n_transf_format, fs_name, action, file_name, (uintmax_t) have,
|
||||
_("bytes transferred"));
|
||||
}
|
||||
|
||||
@ -1203,7 +1202,7 @@ vfs_s_open (struct vfs_class *me, const char *file, int flags, mode_t mode)
|
||||
{
|
||||
if (MEDATA->linear_start)
|
||||
{
|
||||
print_vfs_message (_("Starting linear transfer..."));
|
||||
vfs_print_message (_("Starting linear transfer..."));
|
||||
fh->linear = LS_LINEAR_PREOPEN;
|
||||
}
|
||||
}
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include "lib/strutil.h"
|
||||
#include "lib/util.h"
|
||||
#include "lib/widget.h" /* message() */
|
||||
#include "lib/event.h"
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
#include "lib/charsets.h"
|
||||
@ -1515,3 +1516,17 @@ vfs_file_is_local (const char *filename)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
vfs_print_message (const char *msg, ...)
|
||||
{
|
||||
ev_vfs_print_message_t event_data;
|
||||
|
||||
va_start (event_data.ap, msg);
|
||||
event_data.msg = msg;
|
||||
|
||||
mc_event_raise (MCEVENT_GROUP_CORE, "vfs_print_message", (gpointer) & event_data);
|
||||
va_end (event_data.ap);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -288,5 +288,7 @@ void vfs_release_path (const char *dir);
|
||||
|
||||
void vfs_fill_names (fill_names_f);
|
||||
|
||||
void vfs_print_message (const char *msg, ...) __attribute__ ((format (__printf__, 1, 2)));
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
#endif /* MC_VFS_VFS_H */
|
||||
|
@ -102,6 +102,8 @@ int free_space = 1;
|
||||
/* The starting line for the output of the subprogram */
|
||||
int output_start_y = 0;
|
||||
|
||||
int ok_to_refresh = 1;
|
||||
|
||||
/*** file scope macro definitions ****************************************************************/
|
||||
|
||||
/* The maximum number of views managed by the set_display_type routine */
|
||||
@ -191,7 +193,6 @@ static int output_lines_label_len;
|
||||
|
||||
static WButton *bleft_widget, *bright_widget;
|
||||
|
||||
static int ok_to_refresh = 1;
|
||||
|
||||
/*** file scope functions ************************************************************************/
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
@ -886,45 +887,6 @@ set_hintbar (const char *str)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
print_vfs_message (const char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char str[128];
|
||||
|
||||
va_start (ap, msg);
|
||||
g_vsnprintf (str, sizeof (str), msg, ap);
|
||||
va_end (ap);
|
||||
|
||||
if (mc_global.widget.midnight_shutdown)
|
||||
return;
|
||||
|
||||
if (!mc_global.message_visible || !the_hint || !the_hint->widget.owner)
|
||||
{
|
||||
int col, row;
|
||||
|
||||
if (!nice_rotating_dash || (ok_to_refresh <= 0))
|
||||
return;
|
||||
|
||||
/* Preserve current cursor position */
|
||||
tty_getyx (&row, &col);
|
||||
|
||||
tty_gotoyx (0, 0);
|
||||
tty_setcolor (NORMAL_COLOR);
|
||||
tty_print_string (str_fit_to_term (str, COLS - 1, J_LEFT));
|
||||
|
||||
/* Restore cursor position */
|
||||
tty_gotoyx (row, col);
|
||||
mc_refresh ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mc_global.message_visible)
|
||||
set_hintbar (str);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
rotate_dash (void)
|
||||
{
|
||||
|
@ -66,8 +66,6 @@ void clr_scr (void);
|
||||
void repaint_screen (void);
|
||||
void mc_refresh (void);
|
||||
|
||||
void print_vfs_message (const char *msg, ...) __attribute__ ((format (__printf__, 1, 2)));
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
#endif /* MC__LAYOUT_H */
|
||||
|
@ -86,6 +86,7 @@
|
||||
#include "midnight.h"
|
||||
|
||||
/* TODO: merge content of layout.c here */
|
||||
extern int ok_to_refresh;
|
||||
|
||||
/*** global variables ****************************************************************************/
|
||||
|
||||
@ -548,6 +549,51 @@ check_other_panel_timestamp (const gchar * event_group_name, const gchar * event
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* event callback */
|
||||
static gboolean
|
||||
print_vfs_message (const gchar * event_group_name, const gchar * event_name,
|
||||
gpointer init_data, gpointer data)
|
||||
{
|
||||
char str[128];
|
||||
ev_vfs_print_message_t *event_data = (ev_vfs_print_message_t *) data;
|
||||
|
||||
(void) event_group_name;
|
||||
(void) event_name;
|
||||
(void) init_data;
|
||||
|
||||
g_vsnprintf (str, sizeof (str), event_data->msg, event_data->ap);
|
||||
|
||||
if (mc_global.widget.midnight_shutdown)
|
||||
return TRUE;
|
||||
|
||||
if (!mc_global.message_visible || !the_hint || !the_hint->widget.owner)
|
||||
{
|
||||
int col, row;
|
||||
|
||||
if (!nice_rotating_dash || (ok_to_refresh <= 0))
|
||||
return TRUE;
|
||||
|
||||
/* Preserve current cursor position */
|
||||
tty_getyx (&row, &col);
|
||||
|
||||
tty_gotoyx (0, 0);
|
||||
tty_setcolor (NORMAL_COLOR);
|
||||
tty_print_string (str_fit_to_term (str, COLS - 1, J_LEFT));
|
||||
|
||||
/* Restore cursor position */
|
||||
tty_gotoyx (row, col);
|
||||
mc_refresh ();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (mc_global.message_visible)
|
||||
set_hintbar (str);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
create_panels (void)
|
||||
{
|
||||
@ -608,6 +654,8 @@ create_panels (void)
|
||||
NULL);
|
||||
#endif /* ENABLE_VFS */
|
||||
|
||||
mc_event_add (MCEVENT_GROUP_CORE, "vfs_print_message", print_vfs_message, NULL, NULL);
|
||||
|
||||
/* Create the nice widgets */
|
||||
cmdline = command_new (0, 0, 0);
|
||||
the_prompt = label_new (0, 0, mc_prompt);
|
||||
|
@ -63,7 +63,6 @@
|
||||
#include "lib/fileloc.h"
|
||||
#include "lib/mcconfig.h"
|
||||
|
||||
#include "src/filemanager/layout.h" /* print_vfs_message */
|
||||
#include "src/execute.h" /* pre_exec, post_exec */
|
||||
|
||||
#include "lib/vfs/vfs.h"
|
||||
@ -260,7 +259,7 @@ fish_free_archive (struct vfs_class *me, struct vfs_s_super *super)
|
||||
{
|
||||
if ((SUP.sockw != -1) || (SUP.sockr != -1))
|
||||
{
|
||||
print_vfs_message (_("fish: Disconnecting from %s"), super->name ? super->name : "???");
|
||||
vfs_print_message (_("fish: Disconnecting from %s"), super->name ? super->name : "???");
|
||||
fish_command (me, super, NONE, "#BYE\nexit\n");
|
||||
close (SUP.sockw);
|
||||
close (SUP.sockr);
|
||||
@ -509,7 +508,7 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
|
||||
if (!ftalk)
|
||||
ERRNOR (E_PROTO, -1);
|
||||
|
||||
print_vfs_message (_("fish: Sending initial line..."));
|
||||
vfs_print_message (_("fish: Sending initial line..."));
|
||||
/*
|
||||
* Run `start_fish_server'. If it doesn't exist - no problem,
|
||||
* we'll talk directly to the shell.
|
||||
@ -520,7 +519,7 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
|
||||
"#FISH\necho; start_fish_server 2>&1; echo '### 200'\n") != COMPLETE)
|
||||
ERRNOR (E_PROTO, -1);
|
||||
|
||||
print_vfs_message (_("fish: Handshaking version..."));
|
||||
vfs_print_message (_("fish: Handshaking version..."));
|
||||
if (fish_command (me, super, WAIT_REPLY, "#VER 0.0.3\necho '### 000'\n") != COMPLETE)
|
||||
ERRNOR (E_PROTO, -1);
|
||||
|
||||
@ -530,13 +529,13 @@ fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
|
||||
"LANG=C LC_ALL=C LC_TIME=C; export LANG LC_ALL LC_TIME;\n" "echo '### 200'\n") != COMPLETE)
|
||||
ERRNOR (E_PROTO, -1);
|
||||
|
||||
print_vfs_message (_("fish: Getting host info..."));
|
||||
vfs_print_message (_("fish: Getting host info..."));
|
||||
if (fish_info (me, super))
|
||||
SUP.scr_env = fish_set_env (SUP.host_flags);
|
||||
|
||||
print_vfs_message (_("fish: Setting up current directory..."));
|
||||
vfs_print_message (_("fish: Setting up current directory..."));
|
||||
SUP.cwdir = fish_getcwd (me, super);
|
||||
print_vfs_message (_("fish: Connected, home %s."), SUP.cwdir);
|
||||
vfs_print_message (_("fish: Connected, home %s."), SUP.cwdir);
|
||||
#if 0
|
||||
super->name = g_strconcat ("/#sh:", SUP.user, "@", SUP.host, "/", (char *) NULL);
|
||||
#endif
|
||||
@ -643,7 +642,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
|
||||
#endif
|
||||
logfile = MEDATA->logfile;
|
||||
|
||||
print_vfs_message (_("fish: Reading directory %s..."), remote_path);
|
||||
vfs_print_message (_("fish: Reading directory %s..."), remote_path);
|
||||
|
||||
gettimeofday (&dir->timestamp, NULL);
|
||||
dir->timestamp.tv_sec += fish_directory_timeout;
|
||||
@ -809,7 +808,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
|
||||
{
|
||||
g_free (SUP.cwdir);
|
||||
SUP.cwdir = g_strdup (remote_path);
|
||||
print_vfs_message (_("%s: done."), me->name);
|
||||
vfs_print_message (_("%s: done."), me->name);
|
||||
return 0;
|
||||
}
|
||||
else if (reply_code == ERROR)
|
||||
@ -822,7 +821,7 @@ fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
|
||||
}
|
||||
|
||||
error:
|
||||
print_vfs_message (_("%s: failure"), me->name);
|
||||
vfs_print_message (_("%s: failure"), me->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -880,7 +879,7 @@ fish_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *lo
|
||||
*/
|
||||
|
||||
quoted_name = strutils_shell_escape (name);
|
||||
print_vfs_message (_("fish: store %s: sending command..."), quoted_name);
|
||||
vfs_print_message (_("fish: store %s: sending command..."), quoted_name);
|
||||
|
||||
/* FIXME: File size is limited to ULONG_MAX */
|
||||
if (!fh->u.fish.append)
|
||||
@ -914,7 +913,7 @@ fish_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *lo
|
||||
{
|
||||
if ((errno == EINTR) && tty_got_interrupt ())
|
||||
continue;
|
||||
print_vfs_message (_("fish: Local read failed, sending zeros"));
|
||||
vfs_print_message (_("fish: Local read failed, sending zeros"));
|
||||
close (h);
|
||||
h = open ("/dev/zero", O_RDONLY);
|
||||
}
|
||||
@ -933,7 +932,7 @@ fish_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *lo
|
||||
}
|
||||
tty_disable_interrupt_key ();
|
||||
total += n;
|
||||
print_vfs_message ("%s: %d/%" PRIuMAX,
|
||||
vfs_print_message ("%s: %d/%" PRIuMAX,
|
||||
was_error ? _("fish: storing zeros") : _("fish: storing file"),
|
||||
total, (uintmax_t) s.st_size);
|
||||
}
|
||||
@ -1002,7 +1001,7 @@ fish_linear_abort (struct vfs_class *me, struct vfs_s_fh *fh)
|
||||
char buffer[8192];
|
||||
int n;
|
||||
|
||||
print_vfs_message (_("Aborting transfer..."));
|
||||
vfs_print_message (_("Aborting transfer..."));
|
||||
do
|
||||
{
|
||||
n = MIN (8192, fh->u.fish.total - fh->u.fish.got);
|
||||
@ -1017,9 +1016,9 @@ fish_linear_abort (struct vfs_class *me, struct vfs_s_fh *fh)
|
||||
while (n != 0);
|
||||
|
||||
if (fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE)
|
||||
print_vfs_message (_("Error reported after abort."));
|
||||
vfs_print_message (_("Error reported after abort."));
|
||||
else
|
||||
print_vfs_message (_("Aborted transfer would be successful."));
|
||||
vfs_print_message (_("Aborted transfer would be successful."));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -94,7 +94,6 @@ What to do with this?
|
||||
#include "lib/tty/tty.h" /* enable/disable interrupt key */
|
||||
#include "lib/widget.h" /* message() */
|
||||
|
||||
#include "src/filemanager/layout.h" /* print_vfs_message */
|
||||
#include "src/history.h"
|
||||
#include "src/setup.h" /* for load_anon_passwd */
|
||||
|
||||
@ -508,7 +507,7 @@ ftpfs_free_archive (struct vfs_class *me, struct vfs_s_super *super)
|
||||
{
|
||||
if (SUP.sock != -1)
|
||||
{
|
||||
print_vfs_message (_("ftpfs: Disconnecting from %s"), SUP.host);
|
||||
vfs_print_message (_("ftpfs: Disconnecting from %s"), SUP.host);
|
||||
ftpfs_command (me, super, NONE, "QUIT");
|
||||
close (SUP.sock);
|
||||
}
|
||||
@ -601,12 +600,12 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, const char
|
||||
fflush (MEDATA->logfile);
|
||||
}
|
||||
|
||||
print_vfs_message (_("ftpfs: sending login name"));
|
||||
vfs_print_message (_("ftpfs: sending login name"));
|
||||
|
||||
switch (ftpfs_command (me, super, WAIT_REPLY, "USER %s", name))
|
||||
{
|
||||
case CONTINUE:
|
||||
print_vfs_message (_("ftpfs: sending user password"));
|
||||
vfs_print_message (_("ftpfs: sending user password"));
|
||||
code = ftpfs_command (me, super, WAIT_REPLY, "PASS %s", pass);
|
||||
if (code == CONTINUE)
|
||||
{
|
||||
@ -617,7 +616,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, const char
|
||||
g_free (p);
|
||||
if (op == NULL)
|
||||
ERRNOR (EPERM, 0);
|
||||
print_vfs_message (_("ftpfs: sending user account"));
|
||||
vfs_print_message (_("ftpfs: sending user account"));
|
||||
code = ftpfs_command (me, super, WAIT_REPLY, "ACCT %s", op);
|
||||
g_free (op);
|
||||
}
|
||||
@ -626,7 +625,7 @@ ftpfs_login_server (struct vfs_class *me, struct vfs_s_super *super, const char
|
||||
/* fall through */
|
||||
|
||||
case COMPLETE:
|
||||
print_vfs_message (_("ftpfs: logged in"));
|
||||
vfs_print_message (_("ftpfs: logged in"));
|
||||
wipe_password (pass);
|
||||
g_free (name);
|
||||
return 1;
|
||||
@ -776,7 +775,7 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
||||
|
||||
if (!host || !*host)
|
||||
{
|
||||
print_vfs_message (_("ftpfs: Invalid host name."));
|
||||
vfs_print_message (_("ftpfs: Invalid host name."));
|
||||
ftpfs_errno = EINVAL;
|
||||
g_free (host);
|
||||
return -1;
|
||||
@ -828,7 +827,7 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
||||
if (e != 0)
|
||||
{
|
||||
tty_disable_interrupt_key ();
|
||||
print_vfs_message (_("ftpfs: %s"), gai_strerror (e));
|
||||
vfs_print_message (_("ftpfs: %s"), gai_strerror (e));
|
||||
g_free (host);
|
||||
ftpfs_errno = EINVAL;
|
||||
return -1;
|
||||
@ -846,14 +845,14 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
||||
continue;
|
||||
|
||||
tty_disable_interrupt_key ();
|
||||
print_vfs_message (_("ftpfs: %s"), unix_error_string (errno));
|
||||
vfs_print_message (_("ftpfs: %s"), unix_error_string (errno));
|
||||
g_free (host);
|
||||
freeaddrinfo (res);
|
||||
ftpfs_errno = errno;
|
||||
return -1;
|
||||
}
|
||||
|
||||
print_vfs_message (_("ftpfs: making connection to %s"), host);
|
||||
vfs_print_message (_("ftpfs: making connection to %s"), host);
|
||||
g_free (host);
|
||||
host = NULL;
|
||||
|
||||
@ -865,11 +864,11 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
||||
|
||||
if (errno == EINTR && tty_got_interrupt ())
|
||||
{
|
||||
print_vfs_message (_("ftpfs: connection interrupted by user"));
|
||||
vfs_print_message (_("ftpfs: connection interrupted by user"));
|
||||
}
|
||||
else if (res->ai_next == NULL)
|
||||
{
|
||||
print_vfs_message (_("ftpfs: connection to server failed: %s"),
|
||||
vfs_print_message (_("ftpfs: connection to server failed: %s"),
|
||||
unix_error_string (errno));
|
||||
}
|
||||
else
|
||||
@ -929,7 +928,7 @@ ftpfs_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
|
||||
tty_enable_interrupt_key ();
|
||||
for (count_down = retry_seconds; count_down; count_down--)
|
||||
{
|
||||
print_vfs_message (_("Waiting to retry... %d (Control-C to cancel)"),
|
||||
vfs_print_message (_("Waiting to retry... %d (Control-C to cancel)"),
|
||||
count_down);
|
||||
sleep (1);
|
||||
if (tty_got_interrupt ())
|
||||
@ -1265,7 +1264,7 @@ ftpfs_init_data_socket (struct vfs_class *me, struct vfs_s_super *super,
|
||||
((struct sockaddr_in6 *) data_addr)->sin6_port = 0;
|
||||
break;
|
||||
default:
|
||||
print_vfs_message (_("ftpfs: invalid address family"));
|
||||
vfs_print_message (_("ftpfs: invalid address family"));
|
||||
ERRNOR (EINVAL, -1);
|
||||
}
|
||||
|
||||
@ -1273,7 +1272,7 @@ ftpfs_init_data_socket (struct vfs_class *me, struct vfs_s_super *super,
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
print_vfs_message (_("ftpfs: could not create socket: %s"), unix_error_string (errno));
|
||||
vfs_print_message (_("ftpfs: could not create socket: %s"), unix_error_string (errno));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
@ -1307,7 +1306,7 @@ ftpfs_initconn (struct vfs_class *me, struct vfs_s_super *super)
|
||||
if (ftpfs_setup_passive (me, super, data_sock, &data_addr, &data_addrlen))
|
||||
return data_sock;
|
||||
|
||||
print_vfs_message (_("ftpfs: could not setup passive mode"));
|
||||
vfs_print_message (_("ftpfs: could not setup passive mode"));
|
||||
SUP.use_passive_connection = 0;
|
||||
|
||||
close (data_sock);
|
||||
@ -1407,10 +1406,10 @@ ftpfs_linear_abort (struct vfs_class *me, struct vfs_s_fh *fh)
|
||||
FH_SOCK = -1;
|
||||
SUP.ctl_connection_busy = 0;
|
||||
|
||||
print_vfs_message (_("ftpfs: aborting transfer."));
|
||||
vfs_print_message (_("ftpfs: aborting transfer."));
|
||||
if (send (SUP.sock, ipbuf, sizeof (ipbuf), MSG_OOB) != sizeof (ipbuf))
|
||||
{
|
||||
print_vfs_message (_("ftpfs: abort error: %s"), unix_error_string (errno));
|
||||
vfs_print_message (_("ftpfs: abort error: %s"), unix_error_string (errno));
|
||||
if (dsock != -1)
|
||||
close (dsock);
|
||||
return;
|
||||
@ -1418,7 +1417,7 @@ ftpfs_linear_abort (struct vfs_class *me, struct vfs_s_fh *fh)
|
||||
|
||||
if (ftpfs_command (me, super, NONE, "%cABOR", DM) != COMPLETE)
|
||||
{
|
||||
print_vfs_message (_("ftpfs: abort failed"));
|
||||
vfs_print_message (_("ftpfs: abort failed"));
|
||||
if (dsock != -1)
|
||||
close (dsock);
|
||||
return;
|
||||
@ -1547,7 +1546,7 @@ resolve_symlink_with_ls_options (struct vfs_class *me, struct vfs_s_super *super
|
||||
{
|
||||
if (ftpfs_chdir_internal (bucket, dir->remote_path) != COMPLETE)
|
||||
{
|
||||
print_vfs_message (_("ftpfs: CWD failed."));
|
||||
vfs_print_message (_("ftpfs: CWD failed."));
|
||||
return;
|
||||
}
|
||||
sock = ftpfs_open_data_connection (bucket, "LIST -lLa", ".", TYPE_ASCII, 0);
|
||||
@ -1557,7 +1556,7 @@ resolve_symlink_with_ls_options (struct vfs_class *me, struct vfs_s_super *super
|
||||
|
||||
if (sock == -1)
|
||||
{
|
||||
print_vfs_message (_("ftpfs: couldn't resolve symlink"));
|
||||
vfs_print_message (_("ftpfs: couldn't resolve symlink"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1565,7 +1564,7 @@ resolve_symlink_with_ls_options (struct vfs_class *me, struct vfs_s_super *super
|
||||
if (fp == NULL)
|
||||
{
|
||||
close (sock);
|
||||
print_vfs_message (_("ftpfs: couldn't resolve symlink"));
|
||||
vfs_print_message (_("ftpfs: couldn't resolve symlink"));
|
||||
return;
|
||||
}
|
||||
tty_enable_interrupt_key ();
|
||||
@ -1626,7 +1625,7 @@ resolve_symlink_with_ls_options (struct vfs_class *me, struct vfs_s_super *super
|
||||
static void
|
||||
resolve_symlink (struct vfs_class *me, struct vfs_s_super *super, struct vfs_s_inode *dir)
|
||||
{
|
||||
print_vfs_message (_("Resolving symlink..."));
|
||||
vfs_print_message (_("Resolving symlink..."));
|
||||
|
||||
if (SUP.strict_rfc959_list_cmd)
|
||||
resolve_symlink_without_ls_options (me, super, dir);
|
||||
@ -1650,7 +1649,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
|| (strchr (remote_path, ' ') != NULL);
|
||||
|
||||
again:
|
||||
print_vfs_message (_("ftpfs: Reading FTP directory %s... %s%s"),
|
||||
vfs_print_message (_("ftpfs: Reading FTP directory %s... %s%s"),
|
||||
remote_path,
|
||||
SUP.strict ==
|
||||
RFC_STRICT ? _("(strict rfc959)") : "", cd_first ? _("(chdir first)") : "");
|
||||
@ -1660,7 +1659,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
if (ftpfs_chdir_internal (me, super, remote_path) != COMPLETE)
|
||||
{
|
||||
ftpfs_errno = ENOENT;
|
||||
print_vfs_message (_("ftpfs: CWD failed."));
|
||||
vfs_print_message (_("ftpfs: CWD failed."));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1702,7 +1701,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
close (sock);
|
||||
tty_disable_interrupt_key ();
|
||||
ftpfs_get_reply (me, SUP.sock, NULL, 0);
|
||||
print_vfs_message (_("%s: failure"), me->name);
|
||||
vfs_print_message (_("%s: failure"), me->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1749,7 +1748,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
if (SUP.strict == RFC_AUTODETECT)
|
||||
SUP.strict = RFC_DARING;
|
||||
|
||||
print_vfs_message (_("%s: done."), me->name);
|
||||
vfs_print_message (_("%s: done."), me->name);
|
||||
return 0;
|
||||
|
||||
fallback:
|
||||
@ -1763,7 +1762,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
||||
cd_first = 1;
|
||||
goto again;
|
||||
}
|
||||
print_vfs_message (_("ftpfs: failed; nowhere to fallback to"));
|
||||
vfs_print_message (_("ftpfs: failed; nowhere to fallback to"));
|
||||
ERRNOR (EACCES, -1);
|
||||
}
|
||||
|
||||
@ -1840,7 +1839,7 @@ ftpfs_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *l
|
||||
w_buf += n_written;
|
||||
n_read -= n_written;
|
||||
}
|
||||
print_vfs_message ("%s: %" PRIuMAX "/%" PRIuMAX,
|
||||
vfs_print_message ("%s: %" PRIuMAX "/%" PRIuMAX,
|
||||
_("ftpfs: storing file"), (uintmax_t) n_stored, (uintmax_t) s.st_size);
|
||||
}
|
||||
tty_disable_interrupt_key ();
|
||||
|
@ -59,7 +59,6 @@
|
||||
#include "lib/global.h"
|
||||
|
||||
#include "lib/widget.h" /* message() */
|
||||
#include "src/filemanager/layout.h" /* print_vfs_message */
|
||||
#include "lib/vfs/utilvfs.h"
|
||||
#include "lib/vfs/vfs.h"
|
||||
|
||||
@ -260,7 +259,7 @@ undelfs_loaddel (void)
|
||||
while (ino)
|
||||
{
|
||||
if ((count++ % 1024) == 0)
|
||||
print_vfs_message (_("undelfs: loading deleted files information %d inodes"), count);
|
||||
vfs_print_message (_("undelfs: loading deleted files information %d inodes"), count);
|
||||
if (inode.i_dtime == 0)
|
||||
goto next;
|
||||
|
||||
@ -360,13 +359,13 @@ undelfs_opendir (struct vfs_class *me, const char *dirname)
|
||||
message (D_ERROR, undelfserr, _("Cannot open file %s"), ext2_fname);
|
||||
return 0;
|
||||
}
|
||||
print_vfs_message (_("undelfs: reading inode bitmap..."));
|
||||
vfs_print_message (_("undelfs: reading inode bitmap..."));
|
||||
if (ext2fs_read_inode_bitmap (fs))
|
||||
{
|
||||
message (D_ERROR, undelfserr, _("Cannot load inode bitmap from:\n%s"), ext2_fname);
|
||||
goto quit_opendir;
|
||||
}
|
||||
print_vfs_message (_("undelfs: reading block bitmap..."));
|
||||
vfs_print_message (_("undelfs: reading block bitmap..."));
|
||||
if (ext2fs_read_block_bitmap (fs))
|
||||
{
|
||||
message (D_ERROR, undelfserr, _("Cannot load block bitmap from:\n%s"), ext2_fname);
|
||||
@ -375,10 +374,10 @@ undelfs_opendir (struct vfs_class *me, const char *dirname)
|
||||
/* Now load the deleted information */
|
||||
if (!undelfs_loaddel ())
|
||||
goto quit_opendir;
|
||||
print_vfs_message (_("%s: done."), me->name);
|
||||
vfs_print_message (_("%s: done."), me->name);
|
||||
return fs;
|
||||
quit_opendir:
|
||||
print_vfs_message (_("%s: failure"), me->name);
|
||||
vfs_print_message (_("%s: failure"), me->name);
|
||||
ext2fs_close (fs);
|
||||
fs = NULL;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user