Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
544b9e78
Commit
544b9e78
authored
May 02, 2012
by
Alejandro Mery
Browse files
bin2fex: better error message when input is not a regular file
parent
7ad2a5c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin2fex.c
View file @
544b9e78
...
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
...
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
if
(
fstat
(
fd
[
0
],
&
sb
)
==
-
1
)
if
(
fstat
(
fd
[
0
],
&
sb
)
==
-
1
)
errf
(
"fstat: %s: %s
\n
"
,
filename
[
0
],
strerror
(
errno
));
errf
(
"fstat: %s: %s
\n
"
,
filename
[
0
],
strerror
(
errno
));
else
if
(
!
S_ISREG
(
sb
.
st_mode
))
else
if
(
!
S_ISREG
(
sb
.
st_mode
))
errf
(
"%s:
%s
\n
"
,
filename
[
0
],
s
trerror
(
errno
)
);
errf
(
"%s:
not a regular file (mode:%d).
\n
"
,
filename
[
0
],
s
b
.
st_mode
);
else
if
((
p
=
mmap
(
0
,
sb
.
st_size
,
PROT_READ
,
MAP_SHARED
,
fd
[
0
],
0
))
==
MAP_FAILED
)
else
if
((
p
=
mmap
(
0
,
sb
.
st_size
,
PROT_READ
,
MAP_SHARED
,
fd
[
0
],
0
))
==
MAP_FAILED
)
errf
(
"mmap: %s: %s
\n
"
,
filename
[
0
],
strerror
(
errno
));
errf
(
"mmap: %s: %s
\n
"
,
filename
[
0
],
strerror
(
errno
));
else
{
else
{
...
...
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