mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-27 11:32:51 +00:00
ptp-helper: Make sure to use g_poll() for the main context
The modified main context from https://bugzilla.gnome.org/show_bug.cgi?id=741054 somehow calls setugid(), which abort()s setuid root applications on OSX.
This commit is contained in:
parent
c7c1dcd346
commit
f02de0e9a1
1 changed files with 22 additions and 0 deletions
|
@ -612,6 +612,14 @@ write_clock_id (void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
static gint
|
||||
dummy_poll (GPollFD * fds, guint nfds, gint timeout)
|
||||
{
|
||||
return g_poll (fds, nfds, timeout);
|
||||
}
|
||||
#endif
|
||||
|
||||
gint
|
||||
main (gint argc, gchar ** argv)
|
||||
{
|
||||
|
@ -619,6 +627,20 @@ main (gint argc, gchar ** argv)
|
|||
GMainLoop *loop;
|
||||
GError *err = NULL;
|
||||
|
||||
/* FIXME: Work around some side effects of the changes from
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=741054
|
||||
*
|
||||
* The modified poll function somehow calls setugid(), which
|
||||
* then abort()s the application. Make sure that we use g_poll()
|
||||
* here!
|
||||
*/
|
||||
#ifdef __APPLE__
|
||||
{
|
||||
GMainContext *context = g_main_context_default ();
|
||||
g_main_context_set_poll_func (context, dummy_poll);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PTP_HELPER_SETUID
|
||||
if (setuid (0) < 0)
|
||||
g_error ("not running with superuser privileges");
|
||||
|
|
Loading…
Reference in a new issue