summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-resolv-conf.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-04 11:02:11 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-12 11:44:56 +0200
commit41f6e627d7cfdf1ea50d5adbd7e118589dbcf8db (patch)
tree979f9a42211a4abbad46950b6e069d3f109f68de /src/resolve/resolved-resolv-conf.c
parentfdeea3f4f1c0f78f1014582135d047265098fb82 (diff)
downloadsystemd-41f6e627d7cfdf1ea50d5adbd7e118589dbcf8db.tar.gz
Make fopen_temporary and fopen_temporary_label unlocked
This is partially a refactoring, but also makes many more places use unlocked operations implicitly, i.e. all users of fopen_temporary(). AFAICT, the uses are always for short-lived files which are not shared externally, and are just used within the same context. Locking is not necessary.
Diffstat (limited to 'src/resolve/resolved-resolv-conf.c')
-rw-r--r--src/resolve/resolved-resolv-conf.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/resolve/resolved-resolv-conf.c b/src/resolve/resolved-resolv-conf.c
index 0435791ea0..dfc9a948e3 100644
--- a/src/resolve/resolved-resolv-conf.c
+++ b/src/resolve/resolved-resolv-conf.c
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <resolv.h>
-#include <stdio_ext.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
@@ -359,14 +358,12 @@ int manager_write_resolv_conf(Manager *m) {
if (r < 0)
return log_warning_errno(r, "Failed to open private resolv.conf file for writing: %m");
- (void) __fsetlocking(f_uplink, FSETLOCKING_BYCALLER);
(void) fchmod(fileno(f_uplink), 0644);
r = fopen_temporary_label(PRIVATE_STUB_RESOLV_CONF, PRIVATE_STUB_RESOLV_CONF, &f_stub, &temp_path_stub);
if (r < 0)
return log_warning_errno(r, "Failed to open private stub-resolv.conf file for writing: %m");
- (void) __fsetlocking(f_stub, FSETLOCKING_BYCALLER);
(void) fchmod(fileno(f_stub), 0644);
r = write_uplink_resolv_conf_contents(f_uplink, dns, domains);