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
+9
-9
@@ -824,29 +824,29 @@ static void write_env_var(FILE *f, const char *v) {
|
||||
p = strchr(v, '=');
|
||||
if (!p) {
|
||||
/* Fallback */
|
||||
fputs(v, f);
|
||||
fputc('\n', f);
|
||||
fputs_unlocked(v, f);
|
||||
fputc_unlocked('\n', f);
|
||||
return;
|
||||
}
|
||||
|
||||
p++;
|
||||
fwrite(v, 1, p-v, f);
|
||||
fwrite_unlocked(v, 1, p-v, f);
|
||||
|
||||
if (string_has_cc(p, NULL) || chars_intersect(p, WHITESPACE SHELL_NEED_QUOTES)) {
|
||||
fputc('\"', f);
|
||||
fputc_unlocked('\"', f);
|
||||
|
||||
for (; *p; p++) {
|
||||
if (strchr(SHELL_NEED_ESCAPE, *p))
|
||||
fputc('\\', f);
|
||||
fputc_unlocked('\\', f);
|
||||
|
||||
fputc(*p, f);
|
||||
fputc_unlocked(*p, f);
|
||||
}
|
||||
|
||||
fputc('\"', f);
|
||||
fputc_unlocked('\"', f);
|
||||
} else
|
||||
fputs(p, f);
|
||||
fputs_unlocked(p, f);
|
||||
|
||||
fputc('\n', f);
|
||||
fputc_unlocked('\n', f);
|
||||
}
|
||||
|
||||
int write_env_file(const char *fname, char **l) {
|
||||
|
||||
Reference in New Issue
Block a user