Azure IoT common library
Dependents: STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more
Diff: xio.c
- Revision:
- 21:b92006c5b9ff
- Parent:
- 19:2e0811512ceb
- Child:
- 32:3b68703b9316
diff -r 95abdea56064 -r b92006c5b9ff xio.c --- a/xio.c Fri Feb 10 17:01:36 2017 -0800 +++ b/xio.c Fri Feb 24 14:01:41 2017 -0800 @@ -4,6 +4,7 @@ #include <stdlib.h> #include <stddef.h> #include "azure_c_shared_utility/gballoc.h" +#include "azure_c_shared_utility/optimize_size.h" #include "azure_c_shared_utility/xio.h" static const char* CONCRETE_OPTIONS = "concreteOptions"; @@ -77,7 +78,7 @@ if (xio == NULL) { /* Codes_SRS_XIO_01_021: [If handle is NULL, xio_open shall return a non-zero value.] */ - result = __LINE__; + result = __FAILURE__; } else { @@ -87,7 +88,7 @@ if (xio_instance->io_interface_description->concrete_io_open(xio_instance->concrete_xio_handle, on_io_open_complete, on_io_open_complete_context, on_bytes_received, on_bytes_received_context, on_io_error, on_io_error_context) != 0) { /* Codes_SRS_XIO_01_022: [If the underlying concrete_io_open fails, xio_open shall return a non-zero value.] */ - result = __LINE__; + result = __FAILURE__; } else { @@ -106,7 +107,7 @@ if (xio == NULL) { /* Codes_SRS_XIO_01_025: [If handle is NULL, xio_close shall return a non-zero value.] */ - result = __LINE__; + result = __FAILURE__; } else { @@ -116,7 +117,7 @@ if (xio_instance->io_interface_description->concrete_io_close(xio_instance->concrete_xio_handle, on_io_close_complete, callback_context) != 0) { /* Codes_SRS_XIO_01_026: [If the underlying concrete_io_close fails, xio_close shall return a non-zero value.] */ - result = __LINE__; + result = __FAILURE__; } else { @@ -136,7 +137,7 @@ /* Codes_SRS_XIO_01_010: [If handle is NULL, xio_send shall return a non-zero value.] */ if (xio == NULL) { - result = __LINE__; + result = __FAILURE__; } else { @@ -171,7 +172,7 @@ /* Codes_SRS_XIO_03_030: [If the xio argument or the optionName argument is NULL, xio_setoption shall return a non-zero value.] */ if (xio == NULL || optionName == NULL) { - result = __LINE__; + result = __FAILURE__; } else { @@ -183,7 +184,7 @@ if (OptionHandler_FeedOptions((OPTIONHANDLER_HANDLE)value, xio_instance->concrete_xio_handle) != OPTIONHANDLER_OK) { LogError("unable to OptionHandler_FeedOptions"); - result = __LINE__; + result = __FAILURE__; } else {