Add subsurface_access()

For our usage the method will acept UTF-8 paths,
which are converted to UTF-16 on Win32.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2014-11-13 19:36:08 +02:00 committed by Dirk Hohndel
parent 61dc19d2e0
commit 4096383fb5
5 changed files with 26 additions and 2 deletions

View file

@ -849,7 +849,7 @@ 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)
} else if (subsurface_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);