OSDN Git Service
(root)
/
android-x86
/
system-extras.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe4a031
)
Add a mode to the open(2) call when creating the output file.
author
Ken Sumrall
<ksumrall@android.com>
Thu, 6 Jan 2011 05:00:03 +0000
(21:00 -0800)
committer
Ken Sumrall
<ksumrall@android.com>
Thu, 6 Jan 2011 05:00:03 +0000
(21:00 -0800)
Without this, the mode of the created file is pulled from
garbage on the stack.
Change-Id: If825c5adbf99ea9a3e0b8ed1f1c0135ca732e6e3
ext4_utils/simg2img.c
patch
|
blob
|
history
diff --git
a/ext4_utils/simg2img.c
b/ext4_utils/simg2img.c
index
f2e3149
..
a074b28
100644
(file)
--- a/
ext4_utils/simg2img.c
+++ b/
ext4_utils/simg2img.c
@@
-177,7
+177,7
@@
int main(int argc, char *argv[])
if (strcmp(argv[2], "-") == 0) {
out = STDOUT_FILENO;
} else {
- if ((out = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC)) == 0) {
+ if ((out = open(argv[2], O_WRONLY | O_CREAT | O_TRUNC
, 0666
)) == 0) {
fprintf(stderr, "Cannot open output file %s\n", argv[2]);
exit(-1);
}