Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
bake
Commits
b0bf341a
Commit
b0bf341a
authored
May 11, 2016
by
Philip Carns
Browse files
bug fixes to copy-from utility
parent
2d9df63e
Pipeline
#388
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/bb-copy-from.c
View file @
b0bf341a
...
...
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
return
(
-
1
);
}
fd
=
open
(
argv
[
3
],
O_WR
ONLY
|
O_TRUNC
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
);
fd
=
open
(
argv
[
3
],
O_
RD
WR
|
O_TRUNC
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
);
if
(
fd
<
0
)
{
perror
(
"open output"
);
...
...
@@ -97,8 +97,18 @@ int main(int argc, char **argv)
return
(
-
1
);
}
ret
=
ftruncate
(
fd
,
check_size
);
if
(
ret
<
0
)
{
perror
(
"ftruncate"
);
close
(
fd
);
bake_release_instance
(
bti
);
ABT_finalize
();
return
(
-
1
);
}
local_region
=
mmap
(
NULL
,
check_size
,
PROT_WRITE
,
MAP_SHARED
,
fd
,
0
);
if
(
!
local_region
)
if
(
local_region
==
MAP_FAILED
)
{
perror
(
"mmap"
);
close
(
fd
);
...
...
src/bb-copy-to.c
View file @
b0bf341a
...
...
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
}
local_region
=
mmap
(
NULL
,
statbuf
.
st_size
,
PROT_READ
,
MAP_PRIVATE
,
fd
,
0
);
if
(
!
local_region
)
if
(
local_region
==
MAP_FAILED
)
{
perror
(
"mmap"
);
close
(
fd
);
...
...
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