diff options
author | Simon McVittie <smcv@collabora.com> | 2021-10-10 12:45:50 +0100 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2021-10-11 09:57:47 +0200 |
commit | 22af8f72eccbd8db15a090277ff4df5d1d351b3c (patch) | |
tree | 62b47f0959269ab8bef2e2fbfdec02aa0a617843 | |
parent | 235856771e399fde585d1da57846fec39ab08215 (diff) | |
download | bubblewrap-22af8f72eccbd8db15a090277ff4df5d1d351b3c.tar.gz |
die_with_error: Save errno sooner
We need to save errno immediately, otherwise it could be overwritten
by a failing library call somewhere in the implementation of fprintf.
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r-- | utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -56,10 +56,10 @@ die_with_error (const char *format, ...) va_list args; int errsv; - fprintf (stderr, "bwrap: "); - errsv = errno; + fprintf (stderr, "bwrap: "); + va_start (args, format); vfprintf (stderr, format, args); va_end (args); |