mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
man: fix LogControl1 manpage example
Follow-up for c6b8fffdfaf1f7c9a1dac73e1e54993a06c766c0 (cherry picked from commit 33054db730fb6f2fd6221d38a788e30b95525463) (cherry picked from commit 59243061f62142ee0f74d25e352a55f174f1bb97) (cherry picked from commit 7bcdbf43011f7b1c72a552f126924795a15baf30)
This commit is contained in:
parent
3fc9c413a9
commit
f12531d653
@ -104,7 +104,7 @@ static int property_get(
|
|||||||
return sd_bus_message_append(reply, "s", o->syslog_identifier);
|
return sd_bus_message_append(reply, "s", o->syslog_identifier);
|
||||||
|
|
||||||
return sd_bus_error_setf(error,
|
return sd_bus_error_setf(error,
|
||||||
SD_BUS_ERROR_INVALID_ARGS,
|
SD_BUS_ERROR_UNKNOWN_PROPERTY,
|
||||||
"Unknown property '%s'",
|
"Unknown property '%s'",
|
||||||
property);
|
property);
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ static int property_set(
|
|||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(value, "LogTarget") == 0) {
|
if (strcmp(property, "LogTarget") == 0) {
|
||||||
for (LogTarget i = 0; i < _LOG_TARGET_MAX; i++)
|
for (LogTarget i = 0; i < _LOG_TARGET_MAX; i++)
|
||||||
if (strcmp(value, log_target_table[i]) == 0) {
|
if (strcmp(value, log_target_table[i]) == 0) {
|
||||||
o->log_target = i;
|
o->log_target = i;
|
||||||
@ -153,7 +153,7 @@ static int property_set(
|
|||||||
}
|
}
|
||||||
|
|
||||||
return sd_bus_error_setf(error,
|
return sd_bus_error_setf(error,
|
||||||
SD_BUS_ERROR_INVALID_ARGS,
|
SD_BUS_ERROR_UNKNOWN_PROPERTY,
|
||||||
"Unknown property '%s'",
|
"Unknown property '%s'",
|
||||||
property);
|
property);
|
||||||
}
|
}
|
||||||
@ -187,17 +187,17 @@ int main(int argc, char **argv) {
|
|||||||
*/
|
*/
|
||||||
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
|
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
|
||||||
|
|
||||||
/* Acquire a connection to the bus, letting the library work out the details.
|
|
||||||
* https://www.freedesktop.org/software/systemd/man/sd_bus_default.html
|
|
||||||
*/
|
|
||||||
sd_bus_default(&bus);
|
|
||||||
|
|
||||||
object o = {
|
object o = {
|
||||||
.log_level = LOG_INFO,
|
.log_level = LOG_INFO,
|
||||||
.log_target = LOG_TARGET_JOURNAL,
|
.log_target = LOG_TARGET_JOURNAL,
|
||||||
.syslog_identifier = "example",
|
.syslog_identifier = "example",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Acquire a connection to the bus, letting the library work out the details.
|
||||||
|
* https://www.freedesktop.org/software/systemd/man/sd_bus_default.html
|
||||||
|
*/
|
||||||
|
check(o.log_level, sd_bus_default(&bus));
|
||||||
|
|
||||||
/* Publish an interface on the bus, specifying our well-known object access
|
/* Publish an interface on the bus, specifying our well-known object access
|
||||||
* path and public interface name.
|
* path and public interface name.
|
||||||
* https://www.freedesktop.org/software/systemd/man/sd_bus_add_object.html
|
* https://www.freedesktop.org/software/systemd/man/sd_bus_add_object.html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user