fiasco: Respect simulate flag

This commit is contained in:
Pali Rohár committed 2012-08-12 12:19:33 +02:00
1 parent 1ba42ce46f
commit 2d52d8c3c6
1 file changed
+4
+4
View File
@@ -532,11 +532,13 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) {
printf(" Output file: %s\n", name);
if ( ! simulate ) {
fd = open(name, O_RDWR|O_CREAT|O_TRUNC, 0644);
if ( fd < 0 ) {
ERROR_INFO("Cannot create output file %s", name);
return -1;
}
}
free(name);
@@ -552,11 +554,13 @@ int fiasco_unpack(struct fiasco * fiasco, const char * dir) {
if ( image->layout ) {
if ( ! simulate ) {
fd = open(layout_name, O_RDWR|O_CREAT|O_TRUNC, 0644);
if ( fd < 0 ) {
ERROR_INFO("Cannot create layout file %s", layout_name);
return -1;
}
}
free(layout_name);