summaryrefslogtreecommitdiffstats
path: root/libcpu
diff options
context:
space:
mode:
authorMichael Pratt <[email protected]>2024-10-16 19:53:52 +0000
committerMark Wielaard <[email protected]>2024-10-17 14:53:58 +0200
commit12d58cf3e30dee91ed7aadb6475a15c6e74cc88b (patch)
tree11ec7902bdb28cbe305d4e104628f29882b0a324 /libcpu
parentf8999be1101cca767785ea5a26873184d189c297 (diff)
Remove usage of "unlocked" variant of stdio print functions
These "unlocked" Linux Standard Base variants of standard functions are not available on some systems that are still capable of building Linux and ELFs. The difference is negligible for simple printing to stdout. POSIX also states for the similar putc_unlocked(): These functions can safely be used in a multi-threaded program if and only if they are called while the invoking thread owns the (FILE *) object, as is the case after a successful call to the flockfile() or ftrylockfile() functions. ... These unlocked versions can be safely used only within explicitly locked program regions, using exported locking primitives. and these precautions were never done. Use the standard forms of these print functions. There is inconsistent use of fputc_unlocked() with putc_unlocked(), so consistently use the safer fputc() instead. Signed-off-by: Michael Pratt <[email protected]>
Diffstat (limited to 'libcpu')
-rw-r--r--libcpu/i386_parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcpu/i386_parse.y b/libcpu/i386_parse.y
index 459684c6..5c91e520 100644
--- a/libcpu/i386_parse.y
+++ b/libcpu/i386_parse.y
@@ -1158,7 +1158,7 @@ instrtable_out (void)
EMIT_SUFFIX (w1);
EMIT_SUFFIX (W1);
- fputc_unlocked ('\n', outfile);
+ fputc ('\n', outfile);
for (int i = 0; i < 3; ++i)
{
@@ -1333,7 +1333,7 @@ instrtable_out (void)
b = b->next;
}
- fputc_unlocked ('\n', outfile);
+ fputc ('\n', outfile);
}
fputs ("};\n", outfile);
}