diff options
author | Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it> | 2014-11-12 21:09:57 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-12 14:41:27 -0800 |
commit | e024a5b207bdcc12492ea32a181da31f7597c6e9 (patch) | |
tree | 58030b1d65b936da192455ce1a30e6d5abdbc065 /libdivecomputer.c | |
parent | 2295e0c21ec403d3d026544b612ec84269843285 (diff) | |
download | subsurface-e024a5b207bdcc12492ea32a181da31f7597c6e9.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r-- | libdivecomputer.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) { |