* 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:
Pavel Roskin 2003-11-07 21:15:47 +00:00
parent 106a90ae99
commit 083d26f3c8
3 changed files with 8 additions and 35 deletions

View File

@ -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>
* widget.[ch] (listbox_search_text): Constify "text" argument.

View File

@ -445,35 +445,6 @@ close_error_pipe (int error, char *text)
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.
The new path differs from path in:
Multiple `/'s are collapsed to a single `/'.

View File

@ -214,16 +214,12 @@ free_file (WView *view)
#endif /* HAVE_MMAP */
{
if (view->reading_pipe) {
/* Check error messages */
if (!view->have_frame)
check_error_pipe ();
/* Close pipe */
pclose (view->stdfile);
view->stdfile = NULL;
/* Ignore errors because we don't want to hear about broken pipe */
close_error_pipe (-1, NULL);
/* Close error pipe and show warnings if any */
close_error_pipe (0, NULL);
} else
close_view_file (view);
}