aboutsummaryrefslogtreecommitdiff
path: root/libbb/loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/loop.c')
-rw-r--r--libbb/loop.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libbb/loop.c b/libbb/loop.c
index 7e58b2f85..29128abe4 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -33,11 +33,11 @@ extern int del_loop(const char *device)
33 int fd; 33 int fd;
34 34
35 if ((fd = open(device, O_RDONLY)) < 0) { 35 if ((fd = open(device, O_RDONLY)) < 0) {
36 perror_msg("%s", device); 36 bb_perror_msg("%s", device);
37 return (FALSE); 37 return (FALSE);
38 } 38 }
39 if (ioctl(fd, LOOP_CLR_FD, 0) < 0) { 39 if (ioctl(fd, LOOP_CLR_FD, 0) < 0) {
40 perror_msg("ioctl: LOOP_CLR_FD"); 40 bb_perror_msg("ioctl: LOOP_CLR_FD");
41 return (FALSE); 41 return (FALSE);
42 } 42 }
43 close(fd); 43 close(fd);
@@ -53,12 +53,12 @@ extern int set_loop(const char *device, const char *file, int offset,
53 mode = *loopro ? O_RDONLY : O_RDWR; 53 mode = *loopro ? O_RDONLY : O_RDWR;
54 if ((ffd = open(file, mode)) < 0 && !*loopro 54 if ((ffd = open(file, mode)) < 0 && !*loopro
55 && (errno != EROFS || (ffd = open(file, mode = O_RDONLY)) < 0)) { 55 && (errno != EROFS || (ffd = open(file, mode = O_RDONLY)) < 0)) {
56 perror_msg("%s", file); 56 bb_perror_msg("%s", file);
57 return 1; 57 return 1;
58 } 58 }
59 if ((fd = open(device, mode)) < 0) { 59 if ((fd = open(device, mode)) < 0) {
60 close(ffd); 60 close(ffd);
61 perror_msg("%s", device); 61 bb_perror_msg("%s", device);
62 return 1; 62 return 1;
63 } 63 }
64 *loopro = (mode == O_RDONLY); 64 *loopro = (mode == O_RDONLY);
@@ -70,14 +70,14 @@ extern int set_loop(const char *device, const char *file, int offset,
70 70
71 loopinfo.lo_encrypt_key_size = 0; 71 loopinfo.lo_encrypt_key_size = 0;
72 if (ioctl(fd, LOOP_SET_FD, ffd) < 0) { 72 if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
73 perror_msg("ioctl: LOOP_SET_FD"); 73 bb_perror_msg("ioctl: LOOP_SET_FD");
74 close(fd); 74 close(fd);
75 close(ffd); 75 close(ffd);
76 return 1; 76 return 1;
77 } 77 }
78 if (ioctl(fd, LOOP_SET_STATUS, &loopinfo) < 0) { 78 if (ioctl(fd, LOOP_SET_STATUS, &loopinfo) < 0) {
79 (void) ioctl(fd, LOOP_CLR_FD, 0); 79 (void) ioctl(fd, LOOP_CLR_FD, 0);
80 perror_msg("ioctl: LOOP_SET_STATUS"); 80 bb_perror_msg("ioctl: LOOP_SET_STATUS");
81 close(fd); 81 close(fd);
82 close(ffd); 82 close(ffd);
83 return 1; 83 return 1;