Commit ee278550 authored by Tommy Olofsson's avatar Tommy Olofsson
Browse files

Cleaned up error reporting in decoder.

parent 53336f6b
......@@ -202,9 +202,8 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTES_WRITTEN,
&signature.size);
if (err < 0) {
printf("Failed to get size: %s\n", strerror(-err));
/* labcomm_error_fatal_global(LABCOMM_ERROR_BAD_WRITER, */
/* "Failed to get size: %s\n", strerror(-err)); */
d->on_error(LABCOMM_ERROR_BAD_WRITER, 2,
"Failed to get size: %s\n", strerror(-err));
result = -ENOENT;
goto free_signature_name;
}
......@@ -212,9 +211,8 @@ static int decode_typedef_or_sample(struct labcomm_decoder *d, int kind)
LABCOMM_IOCTL_WRITER_GET_BYTE_POINTER,
&signature.signature);
if (err < 0) {
printf("Failed to get pointer: %s\n", strerror(-err));
/* labcomm_error_fatal_global(LABCOMM_ERROR_BAD_WRITER, */
/* "Failed to get pointer: %s\n", strerror(-err)); */
d->on_error(LABCOMM_ERROR_BAD_WRITER, 2,
"Failed to get pointer: %s\n", strerror(-err));
result = -ENOENT;
goto free_signature_name;
}
......
......@@ -27,6 +27,6 @@ void labcomm_error_fatal_global(enum labcomm_error error,
char *format,
...)
{
printf("Fatal error %d\n", error);
fprintf(stderr, "Fatal error %d\n", error);
exit(1);
}
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