Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_core
Commits
baf6b6bd
Commit
baf6b6bd
authored
13 years ago
by
Jeff Brown
Browse files
Options
Download
Email Patches
Plain Diff
Show why umount failed.
Change-Id: Id2b3fbc46b8dfbe2f05637fb35c298915cd5f524
parent
e877ad7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
toolbox/umount.c
toolbox/umount.c
+6
-5
No files found.
toolbox/umount.c
View file @
baf6b6bd
...
...
@@ -6,6 +6,7 @@
#include <string.h>
#include <unistd.h>
#include <linux/loop.h>
#include <errno.h>
#define LOOPDEV_MAXLEN 64
#define LOOP_MAJOR 7
...
...
@@ -36,7 +37,7 @@ static int is_loop_mount(const char* path, char *loopdev)
f
=
fopen
(
"/proc/mounts"
,
"r"
);
if
(
!
f
)
{
fprintf
(
stdout
,
"could not open /proc/mounts
\n
"
);
fprintf
(
stdout
,
"could not open /proc/mounts
: %s
\n
"
,
strerror
(
errno
)
);
return
-
1
;
}
...
...
@@ -66,8 +67,8 @@ int umount_main(int argc, char *argv[])
}
loop
=
is_loop_mount
(
argv
[
1
],
loopdev
);
if
(
umount
(
argv
[
1
])){
fprintf
(
stderr
,
"failed
.
\n
"
);
if
(
umount
(
argv
[
1
]))
{
fprintf
(
stderr
,
"failed
: %s
\n
"
,
strerror
(
errno
)
);
return
1
;
}
...
...
@@ -75,11 +76,11 @@ int umount_main(int argc, char *argv[])
// free the loop device
loop_fd
=
open
(
loopdev
,
O_RDONLY
);
if
(
loop_fd
<
0
)
{
perror
(
"open loop device failed
"
);
fprintf
(
stderr
,
"open loop device failed
: %s
\n
"
,
strerror
(
errno
)
);
return
1
;
}
if
(
ioctl
(
loop_fd
,
LOOP_CLR_FD
,
0
)
<
0
)
{
perror
(
"ioctl LOOP_CLR_FD failed
"
);
fprintf
(
stderr
,
"ioctl LOOP_CLR_FD failed
: %s
\n
"
,
strerror
(
errno
)
);
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment