summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-21 13:45:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-05-21 13:45:25 -0700
commit00b1469658fc43ec6448cd01e59405bfeeef40cb (patch)
treeecb8fa67098432c49e82c1fd0dcf76f32c3d4b82 /uemis-downloader.c
parent9ca033c55038efed82b8a09dcd84e310a58f2e73 (diff)
parent707a1f7af71b441f333bcf45fd980a176542aab3 (diff)
downloadsubsurface-00b1469658fc43ec6448cd01e59405bfeeef40cb.tar.gz
Merge branch 'v4.4-branch' into newmaster
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index cd375f440..986aeb5b3 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
+#include <errno.h>
#include "gettext.h"
#include "libdivecomputer.h"
@@ -440,6 +441,11 @@ static bool uemis_get_answer(const char *path, char *request, int n_param_in,
int timeout = UEMIS_LONG_TIMEOUT;
reqtxt_file = subsurface_open(reqtxt_path, O_RDWR | O_CREAT, 0666);
+ if (reqtxt_file == -1) {
+ *error_text = "can't open req.txt";
+ fprintf(stderr, "open %s failed with errno %d\n", reqtxt_path, errno);
+ return false;
+ }
snprintf(sb, BUFLEN, "n%04d12345678", filenr);
str_append_with_delim(sb, request);
for (i = 0; i < n_param_in; i++)