From: Kay Sievers Date: Sat, 10 Apr 2010 16:53:48 +0000 (+0200) Subject: hostname-setup: add SuSE compatiblity X-Git-Tag: v1~556 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=206bf5c294d300cf05ee7b17c5bf42a21f6a52c0 hostname-setup: add SuSE compatiblity --- diff --git a/hostname-setup.c b/hostname-setup.c index eca33a985..5f3ee77ac 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