egl/wayland: define set_cloexec_or_close only when mkostemp is not present
authorBoyan Ding <boyan.j.ding@gmail.com>
Fri, 21 Aug 2015 13:44:36 +0000 (21:44 +0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 22 Aug 2015 11:59:01 +0000 (12:59 +0100)
Fixes a compiler warning of defined but not used function when
HAVE_MKOSTEMP is defined.

Fixes: eb3e2562a4b(configure.ac: check for mkostemp())
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
src/egl/drivers/dri2/platform_wayland.c

index dabaf1ebbd177057d35305e9bc392002868e3aed..dbc64ba2d8a5db2b4387c42b9c136a618eedfdbc 100644 (file)
@@ -1227,6 +1227,8 @@ dri2_wl_swrast_get_stride_for_format(int format, int w)
  * Taken from weston shared/os-compatibility.c
  */
 
+#ifndef HAVE_MKOSTEMP
+
 static int
 set_cloexec_or_close(int fd)
 {
@@ -1249,6 +1251,8 @@ err:
    return -1;
 }
 
+#endif
+
 /*
  * Taken from weston shared/os-compatibility.c
  */