[Bug 47054] Make mission-control quit gracefully

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 23 15:20:16 CET 2012


https://bugs.freedesktop.org/show_bug.cgi?id=47054

Simon McVittie <simon.mcvittie at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |review-, nearly there...

--- Comment #5 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-03-23 07:20:16 PDT ---
> +#include <fcntl.h>
> +#include <sys/types.h>
> +#include <sys/socket.h>
> +#include <errno.h>
> +#include <string.h>
>  #include <glib.h>
> +#include <signal.h>

These additions should be #ifdef G_OS_UNIX. At least fcntl.h is non-portable.

> + retval = socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, quit_pipe);

Why a socket pair? All you need is a pipe - you don't need to write to the read
end, read from the write end or use BSD Sockets API (which is what socketpair()
gives you over pipe()).

SOCK_CLOEXEC is non-portable (Linux-only) but with a GLib 2.30 dependency, you
can use g_unix_open_pipe (quit_pipe, FD_CLOEXEC, &error) which does The Right
Thing on all platforms.

Telepathy coding style (space before parenthesis), please.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list