[2/4] event-loop.c: Use correct OS abstraction function for dupfd()

Submitted by Philip Withnall on Nov. 1, 2014, 5:06 p.m.

Details

Message ID 1414861598.2217.27.camel@philip-laptop
State Accepted
Headers show

Not browsing as part of any series.

Commit Message

Philip Withnall Nov. 1, 2014, 5:06 p.m.
Signed-off-by: Philip Withnall <philip at tecnocode.co.uk>
Signed-off-by: Karsten Otto <ottoka at posteo.de>
---
 src/event-loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/event-loop.c b/src/event-loop.c
index a149db9..1f571ba 100644
--- a/src/event-loop.c
+++ b/src/event-loop.c
@@ -134,7 +134,7 @@  wl_event_loop_add_fd(struct wl_event_loop *loop,
 		return NULL;
 
 	source->base.interface = &fd_source_interface;
-	source->base.fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
+	source->base.fd = wl_os_dupfd_cloexec(fd, 0);
 	source->func = func;
 	source->fd = fd;
 

Comments

Le 01/11/2014 18:06, Philip Withnall a écrit :
> Signed-off-by: Philip Withnall <philip at tecnocode.co.uk>
> Signed-off-by: Karsten Otto <ottoka at posteo.de>
> ---
>  src/event-loop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/event-loop.c b/src/event-loop.c
> index a149db9..1f571ba 100644
> --- a/src/event-loop.c
> +++ b/src/event-loop.c
> @@ -134,7 +134,7 @@ wl_event_loop_add_fd(struct wl_event_loop *loop,
>  		return NULL;
>  
>  	source->base.interface = &fd_source_interface;
> -	source->base.fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
> +	source->base.fd = wl_os_dupfd_cloexec(fd, 0);
>  	source->func = func;
>  	source->fd = fd;
>  
Reviewed-by: David Fort <contact at hardening-consulting.com>
On Sat, 01 Nov 2014 17:06:38 +0000
Philip Withnall <philip@tecnocode.co.uk> wrote:

> Signed-off-by: Philip Withnall <philip at tecnocode.co.uk>
> Signed-off-by: Karsten Otto <ottoka at posteo.de>
> ---
>  src/event-loop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/event-loop.c b/src/event-loop.c
> index a149db9..1f571ba 100644
> --- a/src/event-loop.c
> +++ b/src/event-loop.c
> @@ -134,7 +134,7 @@ wl_event_loop_add_fd(struct wl_event_loop *loop,
>  		return NULL;
>  
>  	source->base.interface = &fd_source_interface;
> -	source->base.fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
> +	source->base.fd = wl_os_dupfd_cloexec(fd, 0);
>  	source->func = func;
>  	source->fd = fd;
>  

Pushed.

Thanks,
pq