summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2010-04-10 18:53:48 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-10 18:53:48 +0200
commit206bf5c294d300cf05ee7b17c5bf42a21f6a52c0 (patch)
treed4c0f75200d65744a2147dee9e50bd78b17983a7
parente24067c3ec0e16e94e9620d4f7a06ccc4b637eb4 (diff)
downloadsystemd-206bf5c294d300cf05ee7b17c5bf42a21f6a52c0.tar.gz
hostname-setup: add SuSE compatiblity
-rw-r--r--hostname-setup.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/hostname-setup.c b/hostname-setup.c
index eca33a9853..5f3ee77ac0 100644
--- 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"
+#warning "Don't know how to read the hostname"
return -ENOENT;
#endif