Drop duplicated create_socketpair

This commit is contained in:
Bilal Elmoussaoui 2023-05-25 09:59:45 +02:00
parent 00099bb4a5
commit 6b29de7164
3 changed files with 5 additions and 26 deletions

View File

@ -670,31 +670,6 @@ mks_paintable_listener_disable (MksPaintable *self,
return TRUE;
}
static gboolean
create_socketpair (int *us,
int *them,
GError **error)
{
int fds[2];
int rv;
rv = socketpair (AF_UNIX, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0, fds);
if (rv != 0)
{
int errsv = errno;
g_set_error_literal (error,
G_IO_ERROR,
g_io_error_from_errno (errsv),
g_strerror (errsv));
return FALSE;
}
*us = fds[0];
*them = fds[1];
return TRUE;
}
static void
mks_paintable_connection_cb (GObject *object,

View File

@ -42,6 +42,10 @@ G_BEGIN_DECLS
# define MKS_RETURN(_r) G_STMT_START { typeof(_r) __ret = (_r); return (__ret); } G_STMT_END
#endif
gboolean create_socketpair (int *us,
int *them,
GError **error);
gboolean mks_scroll_event_is_inverted (GdkEvent *event);
void mks_socketpair_connection_new (GDBusConnectionFlags flags,
GCancellable *cancellable,

View File

@ -90,7 +90,7 @@ mks_scroll_event_is_inverted (GdkEvent *event)
}
}
static gboolean
gboolean
create_socketpair (int *us,
int *them,
GError **error)