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
14 struct hash_table *table;
19 + struct flock lock_data;
21 if (filename && hash_table_count (store->table) > 0)
25 /* Lock the file to avoid potential race conditions */
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.