diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-05-11 16:58:02 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2008-05-11 16:58:02 +0000 |
commit | 850c4f98baecf3d3c28e916927d15d3bbd0cd502 (patch) | |
tree | 2578116282c63b614b8ae7574724456ad857b980 /rbutil/sansapatcher/sansaio-posix.c | |
parent | b9ae6664b396a4167ea8cf9ba092241ebba439b1 (diff) | |
download | rockbox-850c4f98baecf3d3c28e916927d15d3bbd0cd502.tar.gz rockbox-850c4f98baecf3d3c28e916927d15d3bbd0cd502.zip |
Make sansapatcher check and report permission denied errors.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17461 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/sansapatcher/sansaio-posix.c')
-rw-r--r-- | rbutil/sansapatcher/sansaio-posix.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rbutil/sansapatcher/sansaio-posix.c b/rbutil/sansapatcher/sansaio-posix.c index 22abc883d2..95677b6b35 100644 --- a/rbutil/sansapatcher/sansaio-posix.c +++ b/rbutil/sansapatcher/sansaio-posix.c @@ -25,6 +25,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> +#include <errno.h> #if defined(linux) || defined (__linux) #include <sys/mount.h> @@ -74,7 +75,8 @@ int sansa_open(struct sansa_t* sansa, int silent) sansa->dh=open(sansa->diskname,O_RDONLY); if (sansa->dh < 0) { if (!silent) perror(sansa->diskname); - return -1; + if(errno == EACCES) return -2; + else return -1; } if(ioctl(sansa->dh,SANSA_SECTORSIZE_IOCTL,&sansa->sector_size) < 0) { |