1
1

Merge commit 'origin/1379_viewer_hangup'

* commit 'origin/1379_viewer_hangup':
  close_error_pipe: return value instead of garbage
  viewer: Ticket: Viewer(F3) hangups at '.patch' viewing
Этот коммит содержится в:
Sergei Trofimovich 2009-06-26 19:05:28 +03:00
родитель b72e83193a c07b5efe45
Коммит 4ff5d7c0a9

Просмотреть файл

@ -355,6 +355,27 @@ void open_error_pipe (void)
close (error_pipe[0]);
error_pipe[0] = -1;
}
else
{
/*
* Settng stderr in nonblocking mode as we close it earlier, than
* program stops. We try to read some error at program startup,
* but we should not block on it.
*
* TODO: make piped stdin/stderr poll()/select()able to get rid
* of following hack.
*/
int fd_flags;
fd_flags = fcntl (error_pipe[0], F_GETFL, NULL);
if (fd_flags != -1)
{
fd_flags |= O_NONBLOCK;
if (fcntl(error_pipe[0], F_SETFL, fd_flags) == -1)
{
/* TODO: handle it somehow */
}
}
}
/* we never write there */
close (error_pipe[1]);
error_pipe[1] = -1;
@ -374,7 +395,7 @@ close_error_pipe (int error, const char *text)
/* already closed */
if (error_pipe[0] == -1)
return;
return 0;
if (error)
title = MSG_ERROR;