[v5,05/11] core: define SO_PEERCRED if it's not defined

Submitted by Leonid Bobrov via wayland-devel on Feb. 13, 2019, 11:39 a.m.

Details

Message ID 20190213113916.75159-5-mazocomp@disroot.org
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Leonid Bobrov via wayland-devel Feb. 13, 2019, 11:39 a.m.
Signed-off-by: Leonid Bobrov <mazocomp@disroot.org>
---
 src/wayland-os.h | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/wayland-os.h b/src/wayland-os.h
index 86685e0..08b38bd 100644
--- a/src/wayland-os.h
+++ b/src/wayland-os.h
@@ -41,6 +41,9 @@  wl_os_event_create_cloexec(void);
 int
 wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
 
+#ifndef SO_PEERCRED
+#define SO_PEERCRED LOCAL_PEERCRED
+#endif
 
 /*
  * The following are for wayland-os.c and the unit tests.

Comments

On Wed, 13 Feb 2019 13:39:10 +0200
Leonid Bobrov via wayland-devel <wayland-devel@lists.freedesktop.org> wrote:

> Signed-off-by: Leonid Bobrov <mazocomp@disroot.org>
> ---
>  src/wayland-os.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/wayland-os.h b/src/wayland-os.h
> index 86685e0..08b38bd 100644
> --- a/src/wayland-os.h
> +++ b/src/wayland-os.h
> @@ -41,6 +41,9 @@ wl_os_event_create_cloexec(void);
>  int
>  wl_os_accept_cloexec(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
>  
> +#ifndef SO_PEERCRED
> +#define SO_PEERCRED LOCAL_PEERCRED
> +#endif
>  
>  /*
>   * The following are for wayland-os.c and the unit tests.

Hi Leonid,

while this is good otherwise, this header is not #including
sys/socket.h which would be necessary to get the definition of
SO_PEERCRED when it does exist.

I believe a

#include <sys/socket.h>

is therefore needed.


Thanks,
pq