mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-09 13:02:01 +03:00
* view.c (free_file): Don't use check_error_pipe(), display
error messages in close_error_pipe(). * utilunix.c (check_error_pipe): Remove, it's unused.
This commit is contained in:
parent
106a90ae99
commit
083d26f3c8
@ -1,3 +1,9 @@
|
|||||||
|
2003-11-07 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* view.c (free_file): Don't use check_error_pipe(), display
|
||||||
|
error messages in close_error_pipe().
|
||||||
|
* utilunix.c (check_error_pipe): Remove, it's unused.
|
||||||
|
|
||||||
2003-10-30 Andrew V. Samoilov <sav@bcs.zp.ua>
|
2003-10-30 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||||
|
|
||||||
* widget.[ch] (listbox_search_text): Constify "text" argument.
|
* widget.[ch] (listbox_search_text): Constify "text" argument.
|
||||||
|
@ -445,35 +445,6 @@ close_error_pipe (int error, char *text)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks for messages in the error pipe,
|
|
||||||
* closes the pipe and displays an error box if needed
|
|
||||||
*/
|
|
||||||
void check_error_pipe (void)
|
|
||||||
{
|
|
||||||
char error[MAX_PIPE_SIZE];
|
|
||||||
int len = 0;
|
|
||||||
if (old_error >= 0){
|
|
||||||
while (len < MAX_PIPE_SIZE)
|
|
||||||
{
|
|
||||||
fd_set select_set;
|
|
||||||
struct timeval timeout;
|
|
||||||
FD_ZERO (&select_set);
|
|
||||||
FD_SET (error_pipe[0], &select_set);
|
|
||||||
timeout.tv_sec = 0;
|
|
||||||
timeout.tv_usec = 0;
|
|
||||||
select (error_pipe[0] + 1, &select_set, 0, 0, &timeout);
|
|
||||||
if (!FD_ISSET (error_pipe[0], &select_set))
|
|
||||||
break;
|
|
||||||
read (error_pipe[0], error + len, 1);
|
|
||||||
len ++;
|
|
||||||
}
|
|
||||||
error[len] = 0;
|
|
||||||
close (error_pipe[0]);
|
|
||||||
}
|
|
||||||
if (len > 0)
|
|
||||||
message (0, _("Warning"), "%s", error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Canonicalize path, and return a new path. Do everything in situ.
|
/* Canonicalize path, and return a new path. Do everything in situ.
|
||||||
The new path differs from path in:
|
The new path differs from path in:
|
||||||
Multiple `/'s are collapsed to a single `/'.
|
Multiple `/'s are collapsed to a single `/'.
|
||||||
|
@ -214,16 +214,12 @@ free_file (WView *view)
|
|||||||
#endif /* HAVE_MMAP */
|
#endif /* HAVE_MMAP */
|
||||||
{
|
{
|
||||||
if (view->reading_pipe) {
|
if (view->reading_pipe) {
|
||||||
/* Check error messages */
|
|
||||||
if (!view->have_frame)
|
|
||||||
check_error_pipe ();
|
|
||||||
|
|
||||||
/* Close pipe */
|
/* Close pipe */
|
||||||
pclose (view->stdfile);
|
pclose (view->stdfile);
|
||||||
view->stdfile = NULL;
|
view->stdfile = NULL;
|
||||||
|
|
||||||
/* Ignore errors because we don't want to hear about broken pipe */
|
/* Close error pipe and show warnings if any */
|
||||||
close_error_pipe (-1, NULL);
|
close_error_pipe (0, NULL);
|
||||||
} else
|
} else
|
||||||
close_view_file (view);
|
close_view_file (view);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user