summaryrefslogtreecommitdiff
path: root/xfce-extra/xfce4-wavelan-plugin/files/xfce4-wavelan-plugin-0.6.2-close-definition.patch
blob: bc27e2c12afc6a776ab75e8d8ee8d57feb42a5a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
https://gitlab.xfce.org/panel-plugins/xfce4-wavelan-plugin/-/merge_requests/4
https://bugs.gentoo.org/799827

From: Olaf Hering <olaf@aepfle.de>
Date: Fri, 25 Jun 2021 19:37:09 +0200
Subject: [PATCH] remove bogus close function

Just close the file descriptor, instead of doing shutdown.

Not doing so was already wrong in 2006.

wi_linux.c:83:1: error: conflicting types for 'close'
 close(int fd)
 ^~~~~
In file included from /usr/include/glib-2.0/gio/gcredentials.h:32:0,
                 from /usr/include/glib-2.0/gio/gio.h:46,
                 from /usr/include/xfce4/libxfce4util/xfce-gio-extensions.h:28,
                 from /usr/include/xfce4/libxfce4util/libxfce4util.h:40,
                 from wi_linux.c:32:
/usr/include/unistd.h:353:12: note: previous declaration of 'close' was here
 extern int close (int __fd);
            ^~~~~
make[2]: *** [Makefile:525: libwavelan_la-wi_linux.lo] Error 1
make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/xfce4-wavelan-plugin-20210505T194034.7ba466b/panel-plugin'

Signed-off-by: Olaf Hering <olaf@aepfle.de>
--- a/panel-plugin/wi_linux.c
+++ b/panel-plugin/wi_linux.c
@@ -31,6 +31,7 @@
 
 #include <libxfce4util/libxfce4util.h>
 
+#include <unistd.h>
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -79,17 +80,9 @@ wi_open(const char *interface)
   return(device);
 }
 
-static void
-close(int fd)
-{
-  shutdown(fd, SHUT_RDWR);
-}
-
 void
 wi_close(struct wi_device *device)
 {
-  g_return_if_fail(device != NULL);
-
   close(device->socket);
   g_free(device);
 }
GitLab