Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable openssf compiler options #8998

Merged
Prev Previous commit
Next Next commit
runtime_tools: Remove usage of obsolete PORT_CONTROL_FLAG_HEAVY
This flag is had no effect since at least R13B.
garazdawi committed Nov 7, 2024
commit d9bff4b4b461adf3dab6f0a77f1e51fea90e7490
9 changes: 1 addition & 8 deletions lib/runtime_tools/c_src/trace_file_drv.c
Original file line number Diff line number Diff line change
@@ -377,17 +377,15 @@ static void trace_file_outputv(ErlDrvData handle, ErlIOVec *ev)
static void trace_file_output(ErlDrvData handle, char *buff,
ErlDrvSizeT bufflen)
{
int heavy = 0;
TraceFileData *data = (TraceFileData *) handle;
unsigned char b[5] = "";
put_be((unsigned) bufflen, b + 1);
switch (my_write(data, (unsigned char *) b, sizeof(b))) {
case 1:
heavy = !0;
case 0:
switch (my_write(data, (unsigned char *) buff, bufflen)) {
case 1:
heavy = !0;
break;
case 0:
break;
case -1:
@@ -408,12 +406,8 @@ static void trace_file_output(ErlDrvData handle, char *buff,
driver_failure_posix(data->port, errno); /* XXX */
return;
}
heavy = !0;
}
}
if (heavy) {
set_port_control_flags(data->port, PORT_CONTROL_FLAG_HEAVY);
}
}

/*
@@ -577,7 +571,6 @@ static int my_write(TraceFileData *data, unsigned char *buff, int siz)
}
memcpy(data->buff, buff + wrote, siz - wrote);
data->buff_pos = siz - wrote;
set_port_control_flags(data->port, PORT_CONTROL_FLAG_HEAVY);
return 1;
}