From 304e1c39bb0d238081558570100eb1f7cc4476ee Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 28 May 2015 17:31:36 +0200 Subject: [PATCH] gmio_core,stl: add new error code GMIO_ERROR_STDIO --- src/gmio_core/error.h | 6 ++++++ src/gmio_stl/stl_io.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gmio_core/error.h b/src/gmio_core/error.h index eba71b7..73c5002 100644 --- a/src/gmio_core/error.h +++ b/src/gmio_core/error.h @@ -44,6 +44,12 @@ enum gmio_error * gmio_transfer::is_stop_requested_func() returned GMIO_TRUE */ GMIO_ERROR_TRANSFER_STOPPED, + /*! An error occured after a call to a function + * + * The caller can check errno to get the real error number + */ + GMIO_ERROR_STDIO, + /*! Unknown error */ GMIO_ERROR_UNKNOWN }; diff --git a/src/gmio_stl/stl_io.c b/src/gmio_stl/stl_io.c index 1bdc609..c053822 100644 --- a/src/gmio_stl/stl_io.c +++ b/src/gmio_stl/stl_io.c @@ -46,7 +46,7 @@ int gmio_stl_read_file( gmio_buffer_deallocate(&trsf.buffer); } else { - error = GMIO_ERROR_UNKNOWN; + error = GMIO_ERROR_STDIO; } return error; @@ -107,7 +107,7 @@ int gmio_stl_write_file( gmio_buffer_deallocate(&trsf.buffer); } else { - error = GMIO_ERROR_UNKNOWN; + error = GMIO_ERROR_STDIO; } return error;