tree-wide: fput[cs]() → fput[cs]_unlocked() wherever that makes sense (#6396)
As a follow-up for db3f45e2d2 let's do the
same for all other cases where we create a FILE* with local scope and
know that no other threads hence can have access to it.
For most cases this shouldn't change much really, but this should speed
dbus introspection and calender time formatting up a bit.
This commit is contained in:
committed by
GitHub
parent
52b1478414
commit
4b61c87511
@@ -102,17 +102,17 @@ static int create_disk(
|
||||
if (!f)
|
||||
return log_error_errno(errno, "Failed to create unit file %s: %m", p);
|
||||
|
||||
fputs("# Automatically generated by systemd-cryptsetup-generator\n\n"
|
||||
"[Unit]\n"
|
||||
"Description=Cryptography Setup for %I\n"
|
||||
"Documentation=man:crypttab(5) man:systemd-cryptsetup-generator(8) man:systemd-cryptsetup@.service(8)\n"
|
||||
"SourcePath=/etc/crypttab\n"
|
||||
"DefaultDependencies=no\n"
|
||||
"Conflicts=umount.target\n"
|
||||
"BindsTo=dev-mapper-%i.device\n"
|
||||
"IgnoreOnIsolate=true\n"
|
||||
"After=cryptsetup-pre.target\n",
|
||||
f);
|
||||
fputs_unlocked("# Automatically generated by systemd-cryptsetup-generator\n\n"
|
||||
"[Unit]\n"
|
||||
"Description=Cryptography Setup for %I\n"
|
||||
"Documentation=man:crypttab(5) man:systemd-cryptsetup-generator(8) man:systemd-cryptsetup@.service(8)\n"
|
||||
"SourcePath=/etc/crypttab\n"
|
||||
"DefaultDependencies=no\n"
|
||||
"Conflicts=umount.target\n"
|
||||
"BindsTo=dev-mapper-%i.device\n"
|
||||
"IgnoreOnIsolate=true\n"
|
||||
"After=cryptsetup-pre.target\n",
|
||||
f);
|
||||
|
||||
if (!nofail)
|
||||
fprintf(f,
|
||||
@@ -120,7 +120,7 @@ static int create_disk(
|
||||
|
||||
if (password) {
|
||||
if (STR_IN_SET(password, "/dev/urandom", "/dev/random", "/dev/hw_random"))
|
||||
fputs("After=systemd-random-seed.service\n", f);
|
||||
fputs_unlocked("After=systemd-random-seed.service\n", f);
|
||||
else if (!STR_IN_SET(password, "-", "none")) {
|
||||
_cleanup_free_ char *uu;
|
||||
|
||||
@@ -152,8 +152,8 @@ static int create_disk(
|
||||
d, d);
|
||||
|
||||
if (swap)
|
||||
fputs("Before=dev-mapper-%i.swap\n",
|
||||
f);
|
||||
fputs_unlocked("Before=dev-mapper-%i.swap\n",
|
||||
f);
|
||||
} else
|
||||
fprintf(f,
|
||||
"RequiresMountsFor=%s\n",
|
||||
|
||||
Reference in New Issue
Block a user