diff options
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 @@ | |||
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | #include <sys/stat.h> | 26 | #include <sys/stat.h> |
27 | #include <sys/ioctl.h> | 27 | #include <sys/ioctl.h> |
28 | #include <errno.h> | ||
28 | 29 | ||
29 | #if defined(linux) || defined (__linux) | 30 | #if defined(linux) || defined (__linux) |
30 | #include <sys/mount.h> | 31 | #include <sys/mount.h> |
@@ -74,7 +75,8 @@ int sansa_open(struct sansa_t* sansa, int silent) | |||
74 | sansa->dh=open(sansa->diskname,O_RDONLY); | 75 | sansa->dh=open(sansa->diskname,O_RDONLY); |
75 | if (sansa->dh < 0) { | 76 | if (sansa->dh < 0) { |
76 | if (!silent) perror(sansa->diskname); | 77 | if (!silent) perror(sansa->diskname); |
77 | return -1; | 78 | if(errno == EACCES) return -2; |
79 | else return -1; | ||
78 | } | 80 | } |
79 | 81 | ||
80 | if(ioctl(sansa->dh,SANSA_SECTORSIZE_IOCTL,&sansa->sector_size) < 0) { | 82 | if(ioctl(sansa->dh,SANSA_SECTORSIZE_IOCTL,&sansa->sector_size) < 0) { |