fiasco: Respect simulate flag
This commit is contained in:
1 parent
1ba42ce46f
commit
2d52d8c3c6
1 file changed
+12
-8
+12
-8
@@ -532,10 +532,12 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) {
|
|||||||
|
|
||||||
printf(" Output file: %s\n", name);
|
printf(" Output file: %s\n", name);
|
||||||
|
|
||||||
fd = open(name, O_RDWR|O_CREAT|O_TRUNC, 0644);
|
if ( ! simulate ) {
|
||||||
if ( fd < 0 ) {
|
fd = open(name, O_RDWR|O_CREAT|O_TRUNC, 0644);
|
||||||
ERROR_INFO("Cannot create output file %s", name);
|
if ( fd < 0 ) {
|
||||||
return -1;
|
ERROR_INFO("Cannot create output file %s", name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
@@ -552,10 +554,12 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) {
|
|||||||
|
|
||||||
if ( image->layout ) {
|
if ( image->layout ) {
|
||||||
|
|
||||||
fd = open(layout_name, O_RDWR|O_CREAT|O_TRUNC, 0644);
|
if ( ! simulate ) {
|
||||||
if ( fd < 0 ) {
|
fd = open(layout_name, O_RDWR|O_CREAT|O_TRUNC, 0644);
|
||||||
ERROR_INFO("Cannot create layout file %s", layout_name);
|
if ( fd < 0 ) {
|
||||||
return -1;
|
ERROR_INFO("Cannot create layout file %s", layout_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(layout_name);
|
free(layout_name);
|
||||||
|
|||||||
Reference in new issue
Block a user