summaryrefslogtreecommitdiff
path: root/libbb/loop.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-08-03 14:16:24 +0000
committerDenis Vlasenko2007-08-03 14:16:24 +0000
commit0e2c9fb4e09fb0c5a47ddc74b0ba53238570599e (patch)
treeab1416450c6c339fdbe3422a4e4243e7d2098541 /libbb/loop.c
parentf223efbcde63c0c01e5b1331f2fc7f1a9c812f20 (diff)
downloadbusybox-0e2c9fb4e09fb0c5a47ddc74b0ba53238570599e.zip
busybox-0e2c9fb4e09fb0c5a47ddc74b0ba53238570599e.tar.gz
mount: print errno on NFS error (again)
Diffstat (limited to 'libbb/loop.c')
-rw-r--r--libbb/loop.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libbb/loop.c b/libbb/loop.c
index 9559d42..6934b7a 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -81,7 +81,8 @@ int del_loop(const char *device)
*/
int set_loop(char **device, const char *file, unsigned long long offset)
{
- char dev[20], *try;
+ char dev[LOOP_NAMESIZE];
+ char *try;
bb_loop_info loopinfo;
struct stat statbuf;
int i, dfd, ffd, mode, rc = -1;
@@ -140,14 +141,14 @@ int set_loop(char **device, const char *file, unsigned long long offset)
rc = -1;
}
close(dfd);
-try_again:
+ try_again:
if (*device) break;
}
close(ffd);
if (!rc) {
if (!*device)
*device = xstrdup(dev);
- return (mode == O_RDONLY) ? 1 : 0;
+ return (mode == O_RDONLY); /* 1:ro, 0:rw */
}
return rc;
}