mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 10:04:32 +03:00
Use TTY function names instead of #define's.
This commit is contained in:
parent
3720285612
commit
fb51cb8241
@ -32,6 +32,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#include "../src/tty/tty.h"
|
#include "../src/tty/tty.h"
|
||||||
|
#include "../src/tty/color.h"
|
||||||
#include "../src/tty/mouse.h"
|
#include "../src/tty/mouse.h"
|
||||||
#include "../src/tty/key.h" /* mi_getch() */
|
#include "../src/tty/key.h" /* mi_getch() */
|
||||||
|
|
||||||
@ -752,7 +753,7 @@ void dlg_run_done (Dlg_head *h)
|
|||||||
void dlg_process_event (Dlg_head *h, int key, Gpm_Event *event)
|
void dlg_process_event (Dlg_head *h, int key, Gpm_Event *event)
|
||||||
{
|
{
|
||||||
if (key == EV_NONE){
|
if (key == EV_NONE){
|
||||||
if (got_interrupt ())
|
if (tty_got_interrupt ())
|
||||||
key = XCTRL('g');
|
key = XCTRL('g');
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
@ -790,7 +791,7 @@ frontend_run_dlg (Dlg_head *h)
|
|||||||
update_cursor (h);
|
update_cursor (h);
|
||||||
|
|
||||||
/* Clear interrupt flag */
|
/* Clear interrupt flag */
|
||||||
got_interrupt ();
|
tty_got_interrupt ();
|
||||||
d_key = get_event (&event, h->mouse_status == MOU_REPEAT, 1);
|
d_key = get_event (&event, h->mouse_status == MOU_REPEAT, 1);
|
||||||
|
|
||||||
dlg_process_event (h, d_key, &event);
|
dlg_process_event (h, d_key, &event);
|
||||||
|
@ -667,8 +667,8 @@ search_content (Dlg_head *h, const char *directory, const char *filename)
|
|||||||
status_update (buffer);
|
status_update (buffer);
|
||||||
tty_refresh ();
|
tty_refresh ();
|
||||||
|
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
got_interrupt ();
|
tty_got_interrupt ();
|
||||||
|
|
||||||
{
|
{
|
||||||
int line = 1;
|
int line = 1;
|
||||||
@ -727,7 +727,7 @@ search_content (Dlg_head *h, const char *directory, const char *filename)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
mc_close (file_fd);
|
mc_close (file_fd);
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
10
src/screen.c
10
src/screen.c
@ -567,7 +567,7 @@ format_file (char *dest, int limit, WPanel *panel, int file_index, int width, in
|
|||||||
tty_setcolor (SELECTED_COLOR);
|
tty_setcolor (SELECTED_COLOR);
|
||||||
else
|
else
|
||||||
tty_setcolor (NORMAL_COLOR);
|
tty_setcolor (NORMAL_COLOR);
|
||||||
one_vline ();
|
tty_print_one_vline ();
|
||||||
length++;
|
length++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -620,7 +620,7 @@ repaint_file (WPanel *panel, int file_index, int mv, int attr, int isstatus)
|
|||||||
addch (' ');
|
addch (' ');
|
||||||
else {
|
else {
|
||||||
tty_setcolor (NORMAL_COLOR);
|
tty_setcolor (NORMAL_COLOR);
|
||||||
one_vline ();
|
tty_print_one_vline ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1224,7 +1224,7 @@ paint_frame (WPanel *panel)
|
|||||||
|
|
||||||
if (side){
|
if (side){
|
||||||
tty_setcolor (NORMAL_COLOR);
|
tty_setcolor (NORMAL_COLOR);
|
||||||
one_vline ();
|
tty_print_one_vline ();
|
||||||
width = panel->widget.cols - panel->widget.cols/2 - 1;
|
width = panel->widget.cols - panel->widget.cols/2 - 1;
|
||||||
} else if (panel->split)
|
} else if (panel->split)
|
||||||
width = panel->widget.cols/2 - 3;
|
width = panel->widget.cols/2 - 3;
|
||||||
@ -1249,8 +1249,8 @@ paint_frame (WPanel *panel)
|
|||||||
width -= format->field_len;
|
width -= format->field_len;
|
||||||
} else {
|
} else {
|
||||||
tty_setcolor (NORMAL_COLOR);
|
tty_setcolor (NORMAL_COLOR);
|
||||||
one_vline ();
|
tty_print_one_vline ();
|
||||||
width --;
|
width--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -518,11 +518,11 @@ init_subshell (void)
|
|||||||
/* Wait until the subshell has started up and processed the command */
|
/* Wait until the subshell has started up and processed the command */
|
||||||
|
|
||||||
subshell_state = RUNNING_COMMAND;
|
subshell_state = RUNNING_COMMAND;
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
if (!feed_subshell (QUIETLY, TRUE)) {
|
if (!feed_subshell (QUIETLY, TRUE)) {
|
||||||
use_subshell = FALSE;
|
use_subshell = FALSE;
|
||||||
}
|
}
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
if (!subshell_alive)
|
if (!subshell_alive)
|
||||||
use_subshell = FALSE; /* Subshell died instantly, so don't use it */
|
use_subshell = FALSE; /* Subshell died instantly, so don't use it */
|
||||||
}
|
}
|
||||||
|
@ -1143,9 +1143,9 @@ get_event (struct Gpm_Event *event, int redo_event, int block)
|
|||||||
timeout.tv_sec = 0;
|
timeout.tv_sec = 0;
|
||||||
timeout.tv_usec = 0;
|
timeout.tv_usec = 0;
|
||||||
}
|
}
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
flag = select (maxfdp + 1, &select_set, NULL, NULL, time_addr);
|
flag = select (maxfdp + 1, &select_set, NULL, NULL, time_addr);
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
|
|
||||||
/* select timed out: it could be for any of the following reasons:
|
/* select timed out: it could be for any of the following reasons:
|
||||||
* redo_event -> it was because of the MOU_REPEAT handler
|
* redo_event -> it was because of the MOU_REPEAT handler
|
||||||
|
@ -51,18 +51,8 @@ extern void tty_print_vline(int top, int left, int length);
|
|||||||
extern void tty_print_hline(int top, int left, int length);
|
extern void tty_print_hline(int top, int left, int length);
|
||||||
extern void tty_draw_box (int y, int x, int rows, int cols);
|
extern void tty_draw_box (int y, int x, int rows, int cols);
|
||||||
|
|
||||||
|
|
||||||
extern char *tty_tgetstr (const char *name);
|
extern char *tty_tgetstr (const char *name);
|
||||||
|
|
||||||
/* legacy interface */
|
|
||||||
|
|
||||||
#define start_interrupt_key() tty_start_interrupt_key()
|
|
||||||
#define enable_interrupt_key() tty_enable_interrupt_key()
|
|
||||||
#define disable_interrupt_key() tty_disable_interrupt_key()
|
|
||||||
#define got_interrupt() tty_got_interrupt()
|
|
||||||
#define one_hline() tty_print_one_hline()
|
|
||||||
#define one_vline() tty_print_one_vline()
|
|
||||||
|
|
||||||
#define KEY_KP_ADD 4001
|
#define KEY_KP_ADD 4001
|
||||||
#define KEY_KP_SUBTRACT 4002
|
#define KEY_KP_SUBTRACT 4002
|
||||||
#define KEY_KP_MULTIPLY 4003
|
#define KEY_KP_MULTIPLY 4003
|
||||||
|
@ -3198,7 +3198,7 @@ do_search (WView *view)
|
|||||||
search_update_steps (view);
|
search_update_steps (view);
|
||||||
view->update_activate = 0;
|
view->update_activate = 0;
|
||||||
|
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -3240,8 +3240,8 @@ do_search (WView *view)
|
|||||||
view->dirty++;
|
view->dirty++;
|
||||||
view_update (view);
|
view_update (view);
|
||||||
|
|
||||||
|
tty_disable_interrupt_key ();
|
||||||
|
|
||||||
disable_interrupt_key ();
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
dlg_run_done (d);
|
dlg_run_done (d);
|
||||||
destroy_dlg (d);
|
destroy_dlg (d);
|
||||||
|
@ -1848,7 +1848,7 @@ listbox_drawscroll (WListbox *l)
|
|||||||
/* Are we at the top? */
|
/* Are we at the top? */
|
||||||
widget_move (&l->widget, 0, l->width);
|
widget_move (&l->widget, 0, l->width);
|
||||||
if (l->list == l->top)
|
if (l->list == l->top)
|
||||||
one_vline ();
|
tty_print_one_vline ();
|
||||||
else
|
else
|
||||||
addch ('^');
|
addch ('^');
|
||||||
|
|
||||||
@ -1856,7 +1856,7 @@ listbox_drawscroll (WListbox *l)
|
|||||||
widget_move (&l->widget, max_line, l->width);
|
widget_move (&l->widget, max_line, l->width);
|
||||||
top = listbox_cdiff (l->list, l->top);
|
top = listbox_cdiff (l->list, l->top);
|
||||||
if ((top + l->height == l->count) || l->height >= l->count)
|
if ((top + l->height == l->count) || l->height >= l->count)
|
||||||
one_vline ();
|
tty_print_one_vline ();
|
||||||
else
|
else
|
||||||
addch ('v');
|
addch ('v');
|
||||||
|
|
||||||
@ -1869,7 +1869,7 @@ listbox_drawscroll (WListbox *l)
|
|||||||
for (i = 1; i < max_line; i++){
|
for (i = 1; i < max_line; i++){
|
||||||
widget_move (&l->widget, i, l->width);
|
widget_move (&l->widget, i, l->width);
|
||||||
if (i != line)
|
if (i != line)
|
||||||
one_vline ();
|
tty_print_one_vline ();
|
||||||
else
|
else
|
||||||
addch ('*');
|
addch ('*');
|
||||||
}
|
}
|
||||||
|
@ -969,8 +969,8 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino)
|
|||||||
goto error_3;
|
goto error_3;
|
||||||
|
|
||||||
/* Clear the interrupt status */
|
/* Clear the interrupt status */
|
||||||
got_interrupt ();
|
tty_got_interrupt ();
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
|
|
||||||
while ((n = MEDATA->linear_read (me, &fh, buffer, sizeof (buffer)))) {
|
while ((n = MEDATA->linear_read (me, &fh, buffer, sizeof (buffer)))) {
|
||||||
int t;
|
int t;
|
||||||
@ -981,7 +981,7 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino)
|
|||||||
vfs_s_print_stats (me->name, _("Getting file"), ino->ent->name,
|
vfs_s_print_stats (me->name, _("Getting file"), ino->ent->name,
|
||||||
total, stat_size);
|
total, stat_size);
|
||||||
|
|
||||||
if (got_interrupt ())
|
if (tty_got_interrupt ())
|
||||||
goto error_1;
|
goto error_1;
|
||||||
|
|
||||||
t = write (handle, buffer, n);
|
t = write (handle, buffer, n);
|
||||||
@ -994,13 +994,13 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino)
|
|||||||
MEDATA->linear_close (me, &fh);
|
MEDATA->linear_close (me, &fh);
|
||||||
close (handle);
|
close (handle);
|
||||||
|
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_1:
|
error_1:
|
||||||
MEDATA->linear_close (me, &fh);
|
MEDATA->linear_close (me, &fh);
|
||||||
error_3:
|
error_3:
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
close (handle);
|
close (handle);
|
||||||
unlink (ino->localname);
|
unlink (ino->localname);
|
||||||
error_4:
|
error_4:
|
||||||
@ -1241,10 +1241,10 @@ vfs_s_get_line_interruptible (struct vfs_class *me, char *buffer, int size, int
|
|||||||
|
|
||||||
(void) me;
|
(void) me;
|
||||||
|
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
for (i = 0; i < size-1; i++){
|
for (i = 0; i < size-1; i++){
|
||||||
n = read (fd, buffer+i, 1);
|
n = read (fd, buffer+i, 1);
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
if (n == -1 && errno == EINTR){
|
if (n == -1 && errno == EINTR){
|
||||||
buffer [i] = 0;
|
buffer [i] = 0;
|
||||||
return EINTR;
|
return EINTR;
|
||||||
|
14
vfs/fish.c
14
vfs/fish.c
@ -157,12 +157,12 @@ fish_command (struct vfs_class *me, struct vfs_s_super *super,
|
|||||||
fflush (logfile);
|
fflush (logfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
|
|
||||||
status = write (SUP.sockw, str, strlen (str));
|
status = write (SUP.sockw, str, strlen (str));
|
||||||
g_free (str);
|
g_free (str);
|
||||||
|
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
return TRANSIENT;
|
return TRANSIENT;
|
||||||
|
|
||||||
@ -749,7 +749,7 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
|
|||||||
while (1) {
|
while (1) {
|
||||||
int t;
|
int t;
|
||||||
while ((n = read(h, buffer, sizeof(buffer))) < 0) {
|
while ((n = read(h, buffer, sizeof(buffer))) < 0) {
|
||||||
if ((errno == EINTR) && got_interrupt())
|
if ((errno == EINTR) && tty_got_interrupt ())
|
||||||
continue;
|
continue;
|
||||||
print_vfs_message(_("fish: Local read failed, sending zeros") );
|
print_vfs_message(_("fish: Local read failed, sending zeros") );
|
||||||
close(h);
|
close(h);
|
||||||
@ -765,7 +765,7 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
|
|||||||
}
|
}
|
||||||
goto error_return;
|
goto error_return;
|
||||||
}
|
}
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
total += n;
|
total += n;
|
||||||
print_vfs_message(_("fish: storing %s %d (%lu)"),
|
print_vfs_message(_("fish: storing %s %d (%lu)"),
|
||||||
was_error ? _("zeros") : _("file"), total,
|
was_error ? _("zeros") : _("file"), total,
|
||||||
@ -861,13 +861,13 @@ fish_linear_read (struct vfs_class *me, struct vfs_s_fh *fh, void *buf, int len)
|
|||||||
struct vfs_s_super *super = FH_SUPER;
|
struct vfs_s_super *super = FH_SUPER;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
len = MIN( fh->u.fish.total - fh->u.fish.got, len );
|
len = MIN( fh->u.fish.total - fh->u.fish.got, len );
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
while (len && ((n = read (SUP.sockr, buf, len))<0)) {
|
while (len && ((n = read (SUP.sockr, buf, len))<0)) {
|
||||||
if ((errno == EINTR) && !got_interrupt())
|
if ((errno == EINTR) && !tty_got_interrupt ())
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
enable_interrupt_key();
|
tty_enable_interrupt_key();
|
||||||
|
|
||||||
if (n>0) fh->u.fish.got += n;
|
if (n>0) fh->u.fish.got += n;
|
||||||
if (n<0) fish_linear_abort(me, fh);
|
if (n<0) fish_linear_abort(me, fh);
|
||||||
|
56
vfs/ftpfs.c
56
vfs/ftpfs.c
@ -358,7 +358,7 @@ ftpfs_command (struct vfs_class *me, struct vfs_s_super *super, int wait_reply,
|
|||||||
}
|
}
|
||||||
|
|
||||||
got_sigpipe = 0;
|
got_sigpipe = 0;
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
status = write (SUP.sock, cmdstr, cmdlen);
|
status = write (SUP.sock, cmdstr, cmdlen);
|
||||||
|
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
@ -377,12 +377,12 @@ ftpfs_command (struct vfs_class *me, struct vfs_s_super *super, int wait_reply,
|
|||||||
got_sigpipe = 1;
|
got_sigpipe = 1;
|
||||||
}
|
}
|
||||||
g_free (cmdstr);
|
g_free (cmdstr);
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
return TRANSIENT;
|
return TRANSIENT;
|
||||||
}
|
}
|
||||||
retry = 0;
|
retry = 0;
|
||||||
ok:
|
ok:
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
|
|
||||||
if (wait_reply)
|
if (wait_reply)
|
||||||
{
|
{
|
||||||
@ -679,8 +679,8 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
|||||||
free_host = 1;
|
free_host = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
enable_interrupt_key(); /* clear the interrupt flag */
|
tty_enable_interrupt_key(); /* clear the interrupt flag */
|
||||||
|
|
||||||
/* Get host address */
|
/* Get host address */
|
||||||
memset ((char *) &server_address, 0, sizeof (server_address));
|
memset ((char *) &server_address, 0, sizeof (server_address));
|
||||||
server_address.sin_family = AF_INET;
|
server_address.sin_family = AF_INET;
|
||||||
@ -688,7 +688,7 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
|||||||
if (server_address.sin_addr.s_addr == INADDR_NONE) {
|
if (server_address.sin_addr.s_addr == INADDR_NONE) {
|
||||||
hp = gethostbyname (host);
|
hp = gethostbyname (host);
|
||||||
if (hp == NULL){
|
if (hp == NULL){
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
print_vfs_message (_("ftpfs: Invalid host address."));
|
print_vfs_message (_("ftpfs: Invalid host address."));
|
||||||
ftpfs_errno = EINVAL;
|
ftpfs_errno = EINVAL;
|
||||||
if (free_host)
|
if (free_host)
|
||||||
@ -705,7 +705,7 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
|||||||
|
|
||||||
/* Connect */
|
/* Connect */
|
||||||
if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
|
if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
ftpfs_errno = errno;
|
ftpfs_errno = errno;
|
||||||
if (free_host)
|
if (free_host)
|
||||||
g_free (host);
|
g_free (host);
|
||||||
@ -719,16 +719,16 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
|||||||
if (connect (my_socket, (struct sockaddr *) &server_address,
|
if (connect (my_socket, (struct sockaddr *) &server_address,
|
||||||
sizeof (server_address)) < 0){
|
sizeof (server_address)) < 0){
|
||||||
ftpfs_errno = errno;
|
ftpfs_errno = errno;
|
||||||
if (errno == EINTR && got_interrupt ())
|
if (errno == EINTR && tty_got_interrupt ())
|
||||||
print_vfs_message (_("ftpfs: connection interrupted by user"));
|
print_vfs_message (_("ftpfs: connection interrupted by user"));
|
||||||
else
|
else
|
||||||
print_vfs_message (_("ftpfs: connection to server failed: %s"),
|
print_vfs_message (_("ftpfs: connection to server failed: %s"),
|
||||||
unix_error_string(errno));
|
unix_error_string(errno));
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
close (my_socket);
|
close (my_socket);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
return my_socket;
|
return my_socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,17 +761,17 @@ ftpfs_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
|
|||||||
}
|
}
|
||||||
if (ftpfs_retry_seconds){
|
if (ftpfs_retry_seconds){
|
||||||
retry_seconds = ftpfs_retry_seconds;
|
retry_seconds = ftpfs_retry_seconds;
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
for (count_down = retry_seconds; count_down; count_down--){
|
for (count_down = retry_seconds; count_down; count_down--){
|
||||||
print_vfs_message (_("Waiting to retry... %d (Control-C to cancel)"), count_down);
|
print_vfs_message (_("Waiting to retry... %d (Control-C to cancel)"), count_down);
|
||||||
sleep (1);
|
sleep (1);
|
||||||
if (got_interrupt ()){
|
if (tty_got_interrupt ()) {
|
||||||
/* ftpfs_errno = E; */
|
/* ftpfs_errno = E; */
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (retry_seconds);
|
} while (retry_seconds);
|
||||||
@ -986,7 +986,7 @@ ftpfs_open_data_connection (struct vfs_class *me, struct vfs_s_super *super, con
|
|||||||
j = ftpfs_command (me, super, WAIT_REPLY, "%s", cmd);
|
j = ftpfs_command (me, super, WAIT_REPLY, "%s", cmd);
|
||||||
if (j != PRELIM)
|
if (j != PRELIM)
|
||||||
ERRNOR (EPERM, -1);
|
ERRNOR (EPERM, -1);
|
||||||
enable_interrupt_key();
|
tty_enable_interrupt_key ();
|
||||||
if (SUP.use_passive_connection)
|
if (SUP.use_passive_connection)
|
||||||
data = s;
|
data = s;
|
||||||
else {
|
else {
|
||||||
@ -997,8 +997,8 @@ ftpfs_open_data_connection (struct vfs_class *me, struct vfs_s_super *super, con
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
close (s);
|
close (s);
|
||||||
}
|
}
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1148,7 +1148,7 @@ resolve_symlink_with_ls_options(struct vfs_class *me, struct vfs_s_super *super,
|
|||||||
print_vfs_message(_("ftpfs: couldn't resolve symlink"));
|
print_vfs_message(_("ftpfs: couldn't resolve symlink"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
enable_interrupt_key();
|
tty_enable_interrupt_key ();
|
||||||
flist = dir->file_list->next;
|
flist = dir->file_list->next;
|
||||||
while (1) {
|
while (1) {
|
||||||
do {
|
do {
|
||||||
@ -1164,7 +1164,7 @@ resolve_symlink_with_ls_options(struct vfs_class *me, struct vfs_s_super *super,
|
|||||||
fputs (buffer, MEDATA->logfile);
|
fputs (buffer, MEDATA->logfile);
|
||||||
fflush (MEDATA->logfile);
|
fflush (MEDATA->logfile);
|
||||||
}
|
}
|
||||||
vfs_die("This code should be commented out\n");
|
vfs_die("This code should be commented out\n");
|
||||||
if (vfs_parse_ls_lga (buffer, &s, &filename, NULL)) {
|
if (vfs_parse_ls_lga (buffer, &s, &filename, NULL)) {
|
||||||
int r = strcmp(fe->name, filename);
|
int r = strcmp(fe->name, filename);
|
||||||
g_free(filename);
|
g_free(filename);
|
||||||
@ -1188,7 +1188,7 @@ vfs_die("This code should be commented out\n");
|
|||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
while (fgets(buffer, sizeof(buffer), fp) != NULL);
|
while (fgets(buffer, sizeof(buffer), fp) != NULL);
|
||||||
disable_interrupt_key();
|
tty_disable_interrupt_key ();
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
ftpfs_get_reply(me, SUP.sock, NULL, 0);
|
ftpfs_get_reply(me, SUP.sock, NULL, 0);
|
||||||
}
|
}
|
||||||
@ -1255,7 +1255,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
|||||||
goto fallback;
|
goto fallback;
|
||||||
|
|
||||||
/* Clear the interrupt flag */
|
/* Clear the interrupt flag */
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int i;
|
int i;
|
||||||
@ -1268,7 +1268,7 @@ ftpfs_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path
|
|||||||
if (res == EINTR) {
|
if (res == EINTR) {
|
||||||
me->verrno = ECONNRESET;
|
me->verrno = ECONNRESET;
|
||||||
close (sock);
|
close (sock);
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
ftpfs_get_reply (me, SUP.sock, NULL, 0);
|
ftpfs_get_reply (me, SUP.sock, NULL, 0);
|
||||||
print_vfs_message (_("%s: failure"), me->name);
|
print_vfs_message (_("%s: failure"), me->name);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1368,11 +1368,11 @@ ftpfs_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name,
|
|||||||
#endif
|
#endif
|
||||||
n_stored = 0;
|
n_stored = 0;
|
||||||
|
|
||||||
enable_interrupt_key ();
|
tty_enable_interrupt_key ();
|
||||||
while (1) {
|
while (1) {
|
||||||
while ((n_read = read (h, buffer, sizeof (buffer))) == -1) {
|
while ((n_read = read (h, buffer, sizeof (buffer))) == -1) {
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
if (got_interrupt ()) {
|
if (tty_got_interrupt ()) {
|
||||||
ftpfs_errno = EINTR;
|
ftpfs_errno = EINTR;
|
||||||
goto error_return;
|
goto error_return;
|
||||||
} else
|
} else
|
||||||
@ -1387,7 +1387,7 @@ ftpfs_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name,
|
|||||||
w_buf = buffer;
|
w_buf = buffer;
|
||||||
while ((n_written = write (sock, w_buf, n_read)) != n_read) {
|
while ((n_written = write (sock, w_buf, n_read)) != n_read) {
|
||||||
if (n_written == -1) {
|
if (n_written == -1) {
|
||||||
if (errno == EINTR && !got_interrupt ()) {
|
if (errno == EINTR && !tty_got_interrupt ()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ftpfs_errno = errno;
|
ftpfs_errno = errno;
|
||||||
@ -1399,14 +1399,14 @@ ftpfs_file_store (struct vfs_class *me, struct vfs_s_fh *fh, char *name,
|
|||||||
print_vfs_message (_("ftpfs: storing file %lu (%lu)"),
|
print_vfs_message (_("ftpfs: storing file %lu (%lu)"),
|
||||||
(unsigned long) n_stored, (unsigned long) s.st_size);
|
(unsigned long) n_stored, (unsigned long) s.st_size);
|
||||||
}
|
}
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
close (sock);
|
close (sock);
|
||||||
close (h);
|
close (h);
|
||||||
if (ftpfs_get_reply (me, SUP.sock, NULL, 0) != COMPLETE)
|
if (ftpfs_get_reply (me, SUP.sock, NULL, 0) != COMPLETE)
|
||||||
ERRNOR (EIO, -1);
|
ERRNOR (EIO, -1);
|
||||||
return 0;
|
return 0;
|
||||||
error_return:
|
error_return:
|
||||||
disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
close (sock);
|
close (sock);
|
||||||
close (h);
|
close (h);
|
||||||
ftpfs_get_reply (me, SUP.sock, NULL, 0);
|
ftpfs_get_reply (me, SUP.sock, NULL, 0);
|
||||||
@ -1437,7 +1437,7 @@ ftpfs_linear_read (struct vfs_class *me, struct vfs_s_fh *fh, void *buf, int len
|
|||||||
struct vfs_s_super *super = FH_SUPER;
|
struct vfs_s_super *super = FH_SUPER;
|
||||||
|
|
||||||
while ((n = read (FH_SOCK, buf, len))<0) {
|
while ((n = read (FH_SOCK, buf, len))<0) {
|
||||||
if ((errno == EINTR) && !got_interrupt())
|
if ((errno == EINTR) && !tty_got_interrupt ())
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user