summaryrefslogtreecommitdiff
path: root/src/hostname/hostnamed.c
diff options
context:
space:
mode:
authorDjalal Harouni <tixxdz@opendz.org>2014-03-11 14:57:14 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-11 17:48:41 +0100
commitf200e8bb34d08616dbcb03d6503d0610f4e7e5bc (patch)
treedf554dc7d482f889958502b7d5659ccec022597d /src/hostname/hostnamed.c
parent94036de887ad5b0dc805abe38b5c1c58b57d9465 (diff)
hostnamed: minor improvements in context_write_data_other()
Prepare context_write_data_other() and rename it to context_write_data_machine_info()
Diffstat (limited to 'src/hostname/hostnamed.c')
-rw-r--r--src/hostname/hostnamed.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index 6aa08cacb0..fab0601b87 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -258,7 +258,7 @@ static int context_write_data_static_hostname(Context *c) {
return write_string_file_atomic_label("/etc/hostname", c->data[PROP_STATIC_HOSTNAME]);
}
-static int context_write_data_other(Context *c) {
+static int context_write_data_machine_info(Context *c) {
static const char * const name[_PROP_MAX] = {
[PROP_PRETTY_HOSTNAME] = "PRETTY_HOSTNAME",
@@ -275,7 +275,7 @@ static int context_write_data_other(Context *c) {
if (r < 0 && r != -ENOENT)
return r;
- for (p = 2; p < _PROP_MAX; p++) {
+ for (p = PROP_PRETTY_HOSTNAME; p <= PROP_CHASSIS; p++) {
char *t, **u;
assert(name[p]);
@@ -510,7 +510,7 @@ static int set_machine_info(Context *c, sd_bus *bus, sd_bus_message *m, int prop
c->data[prop] = h;
}
- r = context_write_data_other(c);
+ r = context_write_data_machine_info(c);
if (r < 0) {
log_error("Failed to write machine info: %s", strerror(-r));
return sd_bus_error_set_errnof(error, r, "Failed to write machine info: %s", strerror(-r));