Skip to content

Commit

Permalink
add hint when fail to write file
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneyang committed Feb 9, 2017
1 parent 23dd400 commit 1810f37
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions source/restore-symbol.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,17 @@ void restore_symbol(NSString * inpath, NSString *outpath, NSString *jsonPath, bo

[outData replaceBytesInRange:NSMakeRange(origin_symbol_table_offset + origin_symbol_table_num * NListSize , 0) withBytes:(const void *)symbol_table_append_data.bytes length:increase_size_symtab];

[outData writeToFile:outpath atomically:true];
chmod(outpath.UTF8String, 0755);
NSError * err = nil;
[outData writeToFile:outpath options:NSDataWritingWithoutOverwriting error:&err];

if (!err) {
chmod(outpath.UTF8String, 0755);
}else{
fprintf(stderr,"Write file error : %s", [err localizedDescription].UTF8String);
return;
}


fprintf(stderr,"=========== Finish ============\n");

}

0 comments on commit 1810f37

Please sign in to comment.