gtk+3: fix dependencies for new gnome/accessibility/at-spi2-core
[oi-userland.git] / components / web / wget / patches / hsts.c.patch
blob3dde808e0e512e8f8e0f458f94a42748993d3ddf
1 flock system call is not available on Solaris but it can be
2 replaced by calling fcntl. This patch will be sent upstream
3 after being reworked into a format that will be acceptable.
5 --- wget-1.17.1/src/hsts.c.orig Tue Jan 12 09:14:54 2016
6 +++ wget-1.17.1/src/hsts.c Tue Jan 12 09:16:55 2016
7 @@ -49,6 +49,7 @@
8 #include <string.h>
9 #include <stdio.h>
10 #include <sys/file.h>
11 +#include <fcntl.h>
13 struct hsts_store {
14 struct hash_table *table;
15 @@ -498,6 +499,7 @@
16 struct_stat st;
17 FILE *fp = NULL;
18 int fd = 0;
19 + struct flock lock_data;
21 if (filename && hash_table_count (store->table) > 0)
23 @@ -506,7 +508,11 @@
25 /* Lock the file to avoid potential race conditions */
26 fd = fileno (fp);
27 - flock (fd, LOCK_EX);
28 + lock_data.l_start = 0;
29 + lock_data.l_len = 0;
30 + lock_data.l_whence = SEEK_SET;
31 + lock_data.l_type = F_WRLCK;
32 + fcntl(fd, F_SETLKW, &lock_data);
34 /* If the file has changed, merge the changes with our in-memory data
35 before dumping them to the file.