Commit 43e342de authored by John van Groningen's avatar John van Groningen
Browse files

fix updating call graph profiling option in abc file, call fseek between read and write

parent 5bf61d59
Pipeline #50045 passed with stage
in 18 seconds
......@@ -1227,7 +1227,7 @@ static int project_node_is_abc_up_to_date (P_NODE project_node)
if (comp_options_position>=0){
FILE *f;
char c;
int c;
f=fopen (abc_file_name,"r+");
if (f==NULL)
......@@ -1246,12 +1246,15 @@ static int project_node_is_abc_up_to_date (P_NODE project_node)
c=fgetc (f);
if (c=='0' || c=='1'){
ungetc (c,f);
char callgraph_profile_c;
if (clean_options & CALLGRAPH_PROFILE_MASK)
fputc ('1',f);
else
fputc ('0',f);
callgraph_profile_c = (clean_options & CALLGRAPH_PROFILE_MASK) ? '1' : '0';
if (c!=callgraph_profile_c){
if (fseek (f,comp_options_position+13,SEEK_SET)!=0)
error_s ("Could not write to file %s\n",abc_file_name);
fputc (callgraph_profile_c,f);
}
} else if (clean_options & CALLGRAPH_PROFILE_MASK)
error_s ("Failed to patch %s for callgraph profiling",abc_file_name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment