From 81680583fd5af8a1fd9b1ee30d5fa3dfc073832a Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 24 Apr 2023 08:35:42 +0100 Subject: [PATCH] GTK save_prefs: fix a wrongly sourced error report. After a failed rename(), we should find out what went wrong by looking in errno itself, not in wctx->error which reported a problem in the previous step. --- gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk.c b/gtk.c index fa9108c..1c96270 100644 --- a/gtk.c +++ b/gtk.c @@ -3079,7 +3079,7 @@ static char *save_prefs(frontend *fe) } if (rename(tmp_path, file_path) < 0) { - const char *os_err = strerror(wctx->error); + const char *os_err = strerror(errno); sprintf(err = snewn(256 + strlen(tmp_path) + strlen(file_path) + strlen(os_err), char), "Unable to save preferences:\n"