chiark / gitweb /
util: make a couple of files we write atomic
[elogind.git] / src / hostnamed.c
index cf2172fd2c127d4ebc6347a5b607c3dd5b8b3eab..68c5715b0e1cc1ed7ab6df2cd510a7407c844d6b 100644 (file)
@@ -201,7 +201,7 @@ static int write_data_static_hostname(void) {
                 return 0;
         }
 
-        return write_one_line_file("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
+        return write_one_line_file_atomic("/etc/hostname", data[PROP_STATIC_HOSTNAME]);
 }
 
 static int write_data_other(void) {