mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
hostname-setup: add SuSE compatiblity
This commit is contained in:
parent
e24067c3ec
commit
206bf5c294
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user