From e024a5b207bdcc12492ea32a181da31f7597c6e9 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Wed, 12 Nov 2014 21:09:57 +0100 Subject: Shows an error about wrong permissions If an import fails, the permissions of the device are tested and an error message that mentions permissions is shown to the user. Signed-off-by: Dirk Hohndel --- libdivecomputer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libdivecomputer.c b/libdivecomputer.c index 77501f6da..991aaaa72 100644 --- a/libdivecomputer.c +++ b/libdivecomputer.c @@ -849,7 +849,9 @@ const char *do_libdivecomputer_import(device_data_t *data) err = do_device_import(data); /* TODO: Show the logfile to the user on error. */ dc_device_close(data->device); - } + } else if (access(data->devname, R_OK | W_OK) != 0) + err = translate("gettextFromC", "Insufficient privileges to open the device %s %s (%s)"); + dc_context_free(data->context); if (fp) { -- cgit v1.2.3-70-g09d2