desktop-file-utils: update to 0.28
[oi-userland.git] / components / cluster / corosync / patches / reserved_sun.patch
blob733069ffc52d23d5740e4cee792c84fc302e8659
1 --- corosync-2.4.5/qdevices/unix-socket.c.~1~ 2019-07-30 14:26:39.000000000 +0000
2 +++ corosync-2.4.5/qdevices/unix-socket.c 2019-08-19 07:55:50.666289527 +0000
3 @@ -46,9 +46,9 @@
4 unix_socket_server_create(const char *path, int non_blocking, int backlog)
6 int s;
7 - struct sockaddr_un sun;
8 + struct sockaddr_un address;
10 - if (strlen(path) >= sizeof(sun.sun_path)) {
11 + if (strlen(path) >= sizeof(address.sun_path)) {
12 errno = ENAMETOOLONG;
13 return (-1);
15 @@ -57,12 +57,12 @@
16 return (-1);
19 - memset(&sun, 0, sizeof(sun));
20 - sun.sun_family = AF_UNIX;
21 + memset(&address, 0, sizeof(sun));
22 + address.sun_family = AF_UNIX;
24 - strncpy(sun.sun_path, path, sizeof(sun.sun_path) - 1);
25 + strncpy(address.sun_path, path, sizeof(address.sun_path) - 1);
26 unlink(path);
27 - if (bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) != 0) {
28 + if (bind(s, (struct sockaddr *)&address, SUN_LEN(&address)) != 0) {
29 close(s);
31 return (-1);
32 @@ -89,9 +89,9 @@
33 unix_socket_client_create(const char *path, int non_blocking)
35 int s;
36 - struct sockaddr_un sun;
37 + struct sockaddr_un address;
39 - if (strlen(path) >= sizeof(sun.sun_path)) {
40 + if (strlen(path) >= sizeof(address.sun_path)) {
41 errno = ENAMETOOLONG;
42 return (-1);
44 @@ -100,10 +100,10 @@
45 return (-1);
48 - memset(&sun, 0, sizeof(sun));
49 - sun.sun_family = AF_UNIX;
50 + memset(&address, 0, sizeof(address));
51 + address.sun_family = AF_UNIX;
53 - strncpy(sun.sun_path, path, sizeof(sun.sun_path) - 1);
54 + strncpy(address.sun_path, path, sizeof(address.sun_path) - 1);
56 if (non_blocking) {
57 if (utils_fd_set_non_blocking(s) != 0) {
58 @@ -113,7 +113,7 @@
62 - if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) != 0) {
63 + if (connect(s, (struct sockaddr *)&address, SUN_LEN(&address)) != 0) {
64 close(s);
66 return (-1);
67 @@ -145,12 +145,12 @@
68 int
69 unix_socket_server_accept(int sock, int non_blocking)
71 - struct sockaddr_un sun;
72 + struct sockaddr_un address;
73 socklen_t sun_len;
74 int client_sock;
76 - sun_len = sizeof(sun);
77 - if ((client_sock = accept(sock, (struct sockaddr *)&sun, &sun_len)) < 0) {
78 + sun_len = sizeof(address);
79 + if ((client_sock = accept(sock, (struct sockaddr *)&address, &sun_len)) < 0) {
80 return (-1);