chiark / gitweb /
sysctl: implement native sysctl tool to support Debian-style /etc/sysctl.d
[elogind.git] / src / util.c
index 861f9eaa437ba8c5fbe7f768979473cabfc8ee82..0cd78f6561e9b03633e9b97567d0b38e6c31eb0e 100644 (file)
@@ -495,6 +495,9 @@ int write_one_line_file(const char *fn, const char *line) {
                 goto finish;
         }
 
+        if (!endswith(line, "\n"))
+                fputc('\n', f);
+
         r = 0;
 finish:
         fclose(f);