chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e24067c
)
hostname-setup: add SuSE compatiblity
author
Kay Sievers
<kay.sievers@vrfy.org>
Sat, 10 Apr 2010 16:53:48 +0000
(18:53 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Sat, 10 Apr 2010 16:53:48 +0000
(18:53 +0200)
hostname-setup.c
patch
|
blob
|
history
diff --git
a/hostname-setup.c
b/hostname-setup.c
index eca33a98533b35af7c15c015756954f9b93626c6..5f3ee77ac01a61d3ffc94745d5609f967f47ba46 100644
(file)
--- a/
hostname-setup.c
+++ b/
hostname-setup.c
@@
-75,6
+75,23
@@
finish:
fclose(f);
return r;
+#elif defined(TARGET_SUSE)
+ int r;
+ char *s, *k;
+
+ assert(hn);
+
+ if ((r = read_one_line_file("/etc/HOSTNAME", &s)) < 0)
+ return r;
+
+ k = strdup(strstrip(s));
+ free(s);
+
+ if (!k)
+ return -ENOMEM;
+
+ *hn = k;
+
#elif defined(TARGET_DEBIAN)
int r;
char *s, *k;
@@
-92,7
+109,7
@@
finish:
*hn = k;
#else
-#warn "Don't know how to read the hostname"
+#warn
ing
"Don't know how to read the hostname"
return -ENOENT;
#endif