Merge pull request #27114 from keszybz/trivial-cleanups
Trivial cleanups
This commit is contained in:
@@ -83,12 +83,12 @@
|
||||
service manager supports via <option>RootDirectory=</option>/<option>RootImage=</option>. Similar to
|
||||
them they may optionally carry Verity authentication information.</para>
|
||||
|
||||
<para>System extensions are automatically looked for in the directories
|
||||
<para>System extensions are searched for in the directories
|
||||
<filename>/etc/extensions/</filename>, <filename>/run/extensions/</filename> and
|
||||
<filename>/var/lib/extensions/</filename>. The first two listed directories are not suitable for
|
||||
carrying large binary images, however are still useful for carrying symlinks to them. The primary place
|
||||
for installing system extensions is <filename>/var/lib/extensions/</filename>. Any directories found in
|
||||
these search directories are considered directory based extension images, any files with the
|
||||
these search directories are considered directory based extension images; any files with the
|
||||
<filename>.raw</filename> suffix are considered disk image based extension images.</para>
|
||||
|
||||
<para>During boot OS extension images are activated automatically, if the
|
||||
|
||||
+1
-1
@@ -824,7 +824,7 @@ int conservative_renameat(
|
||||
* have the exact same contents and basic file attributes already. In that case remove the new file
|
||||
* instead. This call is useful for reducing inotify wakeups on files that are updated but don't
|
||||
* actually change. This function is written in a style that we rather rename too often than suppress
|
||||
* too much. i.e. whenever we are in doubt we rather rename than fail. After all reducing inotify
|
||||
* too much. I.e. whenever we are in doubt, we rather rename than fail. After all reducing inotify
|
||||
* events is an optimization only, not more. */
|
||||
|
||||
old_fd = openat(olddirfd, oldpath, O_CLOEXEC|O_RDONLY|O_NOCTTY|O_NOFOLLOW);
|
||||
|
||||
+2
-5
@@ -33,11 +33,8 @@ int mkdirat_safe_internal(
|
||||
assert(_mkdirat && _mkdirat != mkdirat);
|
||||
|
||||
r = _mkdirat(dir_fd, path, mode);
|
||||
if (r >= 0) {
|
||||
r = chmod_and_chown_at(dir_fd, path, mode, uid, gid);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
if (r >= 0)
|
||||
return chmod_and_chown_at(dir_fd, path, mode, uid, gid);
|
||||
if (r != -EEXIST)
|
||||
return r;
|
||||
|
||||
|
||||
+1
-3
@@ -875,7 +875,6 @@ static int service_load(Unit *u) {
|
||||
}
|
||||
|
||||
static void service_dump(Unit *u, FILE *f, const char *prefix) {
|
||||
ServiceExecCommand c;
|
||||
Service *s = SERVICE(u);
|
||||
const char *prefix2;
|
||||
|
||||
@@ -977,8 +976,7 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) {
|
||||
kill_context_dump(&s->kill_context, f, prefix);
|
||||
exec_context_dump(&s->exec_context, f, prefix);
|
||||
|
||||
for (c = 0; c < _SERVICE_EXEC_COMMAND_MAX; c++) {
|
||||
|
||||
for (ServiceExecCommand c = 0; c < _SERVICE_EXEC_COMMAND_MAX; c++) {
|
||||
if (!s->exec_command[c])
|
||||
continue;
|
||||
|
||||
|
||||
@@ -427,14 +427,14 @@ int exec_command_flags_to_strv(ExecCommandFlags flags, char ***ex_opts) {
|
||||
_cleanup_strv_free_ char **ret_opts = NULL;
|
||||
ExecCommandFlags it = flags;
|
||||
const char *str;
|
||||
int i, r;
|
||||
int r;
|
||||
|
||||
assert(ex_opts);
|
||||
|
||||
if (flags < 0)
|
||||
return flags;
|
||||
|
||||
for (i = 0; it != 0; it &= ~(1 << i), i++) {
|
||||
for (unsigned i = 0; it != 0; it &= ~(1 << i), i++)
|
||||
if (FLAGS_SET(flags, (1 << i))) {
|
||||
str = exec_command_flags_to_string(1 << i);
|
||||
if (!str)
|
||||
@@ -444,7 +444,6 @@ int exec_command_flags_to_strv(ExecCommandFlags flags, char ***ex_opts) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
*ex_opts = TAKE_PTR(ret_opts);
|
||||
|
||||
@@ -466,9 +465,7 @@ static const char* const exec_command_strings[] = {
|
||||
};
|
||||
|
||||
const char* exec_command_flags_to_string(ExecCommandFlags i) {
|
||||
size_t idx;
|
||||
|
||||
for (idx = 0; idx < ELEMENTSOF(exec_command_strings); idx++)
|
||||
for (size_t idx = 0; idx < ELEMENTSOF(exec_command_strings); idx++)
|
||||
if (i == (1 << idx))
|
||||
return exec_command_strings[idx];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user