summaryrefslogtreecommitdiffstats
path: root/rbutil/ipodpatcher/ipodio-posix.c
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-05-04 11:59:04 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-05-04 11:59:04 +0000
commit194b2ca887f44e6c3e0244e7f4733060e7aa1618 (patch)
treed74a7230e663e06fbd3b3b3830f4a7c3ceafc43e /rbutil/ipodpatcher/ipodio-posix.c
parentdaa8341a13ddc93981d2c2178b183a13b5e08950 (diff)
downloadrockbox-194b2ca887f44e6c3e0244e7f4733060e7aa1618.tar.gz
rockbox-194b2ca887f44e6c3e0244e7f4733060e7aa1618.tar.bz2
rockbox-194b2ca887f44e6c3e0244e7f4733060e7aa1618.zip
Check for permission denied error when trying to access the player and inform the user that raw disc access permissions are required.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17351 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/ipodpatcher/ipodio-posix.c')
-rw-r--r--rbutil/ipodpatcher/ipodio-posix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rbutil/ipodpatcher/ipodio-posix.c b/rbutil/ipodpatcher/ipodio-posix.c
index 55f0187263..c62e0c8275 100644
--- a/rbutil/ipodpatcher/ipodio-posix.c
+++ b/rbutil/ipodpatcher/ipodio-posix.c
@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
+#include <errno.h>
#include "ipodio.h"
@@ -105,7 +106,8 @@ int ipod_open(struct ipod_t* ipod, int silent)
ipod->dh=open(ipod->diskname,O_RDONLY);
if (ipod->dh < 0) {
if (!silent) perror(ipod->diskname);
- return -1;
+ if(errno == EACCES) return -2;
+ else return -1;
}
/* Read information about the disk */