mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use the actual error number
According to the man page, fopen and fclose return the error number in the global variable errno. Fixes CID 350115 Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
f370446236
commit
143da031ce
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
#include "core/subsurface-string.h"
|
#include "core/subsurface-string.h"
|
||||||
#include "core/save-profiledata.h"
|
#include "core/save-profiledata.h"
|
||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
static void put_int(struct membuffer *b, int val)
|
static void put_int(struct membuffer *b, int val)
|
||||||
{
|
{
|
||||||
|
@ -257,7 +258,7 @@ int save_profiledata(const char *filename, const bool select_only)
|
||||||
error = fclose(f);
|
error = fclose(f);
|
||||||
}
|
}
|
||||||
if (error)
|
if (error)
|
||||||
report_error("Save failed (%s)", strerror(error));
|
report_error("Save failed (%s)", strerror(errno));
|
||||||
|
|
||||||
free_buffer(&buf);
|
free_buffer(&buf);
|
||||||
return error;
|
return error;
|
||||||
|
|
Loading…
Add table
Reference in a new issue