[PATCH v2 1/4] printertask.c: Fix Unchecked return value (CID #1399710)
Ryan Long
thisisryanlong at gmail.com
Fri Feb 26 22:14:52 UTC 2021
CID 1399710: Unchecked return value in printer_task().
CID 1472764: Unchecked return value in rtems_print_printer_task().
Closes #4258
---
cpukit/libcsupport/src/printertask.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/cpukit/libcsupport/src/printertask.c b/cpukit/libcsupport/src/printertask.c
index bae623b..31d569f 100644
--- a/cpukit/libcsupport/src/printertask.c
+++ b/cpukit/libcsupport/src/printertask.c
@@ -117,6 +117,8 @@ static void printer_task( rtems_task_argument arg )
{
rtems_printer_task_context *ctx;
int fd;
+ int err;
+ rtems_status_code sc;
ctx = (rtems_printer_task_context *) arg;
fd = ctx->fd;
@@ -141,8 +143,10 @@ static void printer_task( rtems_task_argument arg )
printer_task_append_buffer( ctx, &ctx->free_buffers, buffer );
break;
case ACTION_DRAIN:
- fsync(fd);
- rtems_event_transient_send( buffer->action_data.task );
+ err = fsync(fd);
+ _Assert_Unused_variable_equals(err, 0);
+ sc = rtems_event_transient_send( buffer->action_data.task );
+ _Assert_Unused_variable_equals(sc, RTEMS_SUCCESSFUL);
break;
}
}
@@ -185,7 +189,8 @@ int rtems_print_printer_task(
printer->context = ctx;
printer->printer = printer_task_printer;
- rtems_task_start( ctx->task, printer_task, (rtems_task_argument) ctx );
+ sc = rtems_task_start( ctx->task, printer_task, (rtems_task_argument) ctx );
+ _Assert_Unused_variable_equals(sc, RTEMS_SUCCESSFUL);
return 0;
}
--
1.8.3.1
More information about the devel
mailing list