Commit 26745bf5 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

loop around select() as long as it returns EINTR. Enables debugging of

2007-09-29  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimp.c (gimp_extension_process): loop around select() as
	long as it returns EINTR. Enables debugging of script-fu on
	OSX (and maybe all BSDish systems).


svn path=/trunk/; revision=23686
parent 4c0b47c3
2007-09-29 Michael Natterer <mitch@gimp.org>
* libgimp/gimp.c (gimp_extension_process): loop around select() as
long as it returns EINTR. Enables debugging of script-fu on
OSX (and maybe all BSDish systems).
2007-09-28 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/script-fu-console.c: allocate the
......@@ -1339,32 +1339,37 @@ void
gimp_extension_process (guint timeout)
{
#ifndef G_OS_WIN32
fd_set readfds;
gint select_val;
struct timeval tv;
struct timeval *tvp;
gint select_val;
if (timeout)
do
{
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
tvp = &tv;
}
else
tvp = NULL;
FD_ZERO (&readfds);
FD_SET (g_io_channel_unix_get_fd (_readchannel), &readfds);
if ((select_val = select (FD_SETSIZE, &readfds, NULL, NULL, tvp)) > 0)
{
gimp_single_message ();
}
else if (select_val == -1)
{
perror ("gimp_extension_process");
gimp_quit ();
fd_set readfds;
struct timeval tv;
struct timeval *tvp;
if (timeout)
{
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
tvp = &tv;
}
else
tvp = NULL;
FD_ZERO (&readfds);
FD_SET (g_io_channel_unix_get_fd (_readchannel), &readfds);
if ((select_val = select (FD_SETSIZE, &readfds, NULL, NULL, tvp)) > 0)
{
gimp_single_message ();
}
else if (select_val == -1 && errno != EINTR)
{
perror ("gimp_extension_process");
gimp_quit ();
}
}
while (select_val == -1 && errno == EINTR);
#else
/* Zero means infinite wait for us, but g_poll and
* g_io_channel_win32_poll use -1 to indicate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment