mirror of
https://github.com/systemd/systemd.git
synced 2025-02-28 05:57:33 +03:00
systemctl: do not show SourcePath when FragmentPath cannot be found
Those files can be in a completely deferent format and also arbitrarily long, and usually contain information about other stuff. If we ever add SourceLine= or SourceLines= in addition to SourcePath=, and can show the relevant information only, this commit can be reverted.
This commit is contained in:
parent
e93c33d4aa
commit
e4c0fbe50c
@ -737,10 +737,10 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
|
||||
<term><command>cat <replaceable>NAME</replaceable>...</command></term>
|
||||
|
||||
<listitem>
|
||||
<para>Show backing files of one or more units.
|
||||
Prints the fragment, drop-ins, and source (sysvinit compat)
|
||||
of units. Each file is preceded by a comment which includes the
|
||||
file name.</para>
|
||||
<para>Show backing files of one or more units. Prints the
|
||||
"fragment" and "drop-ins" (source files) of units. Each
|
||||
file is preceded by a comment which includes the file
|
||||
name.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
|
@ -3718,23 +3718,6 @@ static int cat(sd_bus *bus, char **args) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isempty(fragment_path)) {
|
||||
free(fragment_path);
|
||||
fragment_path = NULL;
|
||||
|
||||
if (sd_bus_get_property_string(
|
||||
bus,
|
||||
"org.freedesktop.systemd1",
|
||||
unit,
|
||||
"org.freedesktop.systemd1.Unit",
|
||||
"SourcePath",
|
||||
&error,
|
||||
&fragment_path) < 0) {
|
||||
log_warning("Failed to get SourcePath: %s", bus_error_message(&error, r));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
r = sd_bus_get_property_strv(
|
||||
bus,
|
||||
"org.freedesktop.systemd1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user