EINTR and simple main loop?

Markku Savela msa at moth.iki.fi
Tue Aug 5 00:26:42 PDT 2008


I needed a simple DBus based service, which needed to manage some
child processes. I didn't want to spend too much time on DBus details,
so I used the simplest main loop

 while (dbus_connection_read_write_dispatch(...))
   {
   something();
   }

Because messing with complex data structures in signal handler is
problematic, I just set simple global flags that something has
changed, and wanted to do the actual "cleanup" in the "something()".

However, the event loop does not appear to "cycle" on signals (EINTR).

Is there any simple way to get this happen? Or, is the only way to
make my own event loop?



More information about the dbus mailing list