chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
swap: don't add too many deps for swap files form /proc/swap
[elogind.git]
/
src
/
core
/
hostname-setup.c
diff --git
a/src/core/hostname-setup.c
b/src/core/hostname-setup.c
index 7894f8a5f2e5f35528d8512e5359f73a778c375e..57baa7927504197d881a024ede7304cfad18ad3a 100644
(file)
--- a/
src/core/hostname-setup.c
+++ b/
src/core/hostname-setup.c
@@
-29,6
+29,7
@@
#include "macro.h"
#include "util.h"
#include "log.h"
#include "macro.h"
#include "util.h"
#include "log.h"
+#include "fileio.h"
static int read_and_strip_hostname(const char *path, char **hn) {
char *s;
static int read_and_strip_hostname(const char *path, char **hn) {
char *s;
@@
-41,7
+42,7
@@
static int read_and_strip_hostname(const char *path, char **hn) {
if (r < 0)
return r;
if (r < 0)
return r;
- hostname_cleanup(s);
+ hostname_cleanup(s
, false
);
if (isempty(s)) {
free(s);
if (isempty(s)) {
free(s);
@@
-81,7
+82,7
@@
int hostname_setup(void) {
hn = "localhost";
}
hn = "localhost";
}
- if (sethostname
(hn, strlen(hn)
) < 0) {
+ if (sethostname
_idempotent(hn
) < 0) {
log_warning("Failed to set hostname to <%s>: %m", hn);
return -errno;
}
log_warning("Failed to set hostname to <%s>: %m", hn);
return -errno;
}