summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2021-10-10 12:45:50 +0100
committerAlexander Larsson <alexander.larsson@gmail.com>2021-10-11 09:57:47 +0200
commit22af8f72eccbd8db15a090277ff4df5d1d351b3c (patch)
tree62b47f0959269ab8bef2e2fbfdec02aa0a617843
parent235856771e399fde585d1da57846fec39ab08215 (diff)
downloadbubblewrap-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index 9901ea0..47e3174 100644
--- a/utils.c
+++ b/utils.c
@@ -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);