From 7853845eb152efb8a7f51ea6f8819adbfae01bd1 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Fri, 12 Mar 2021 17:53:14 -0500 Subject: [PATCH] Fix #867, better error translation for ESPIPE errno The ESPIPE errno means that seeking is not supported on the given file handle. Translate to the OS_ERR_OPERATION_NOT_SUPPORTED error rather than not implemented as it better indicates the actual condition. --- src/os/portable/os-impl-posix-io.c | 2 +- src/unit-test-coverage/portable/src/coveragetest-posix-io.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/portable/os-impl-posix-io.c b/src/os/portable/os-impl-posix-io.c index cabe43541..f6b2e3107 100644 --- a/src/os/portable/os-impl-posix-io.c +++ b/src/os/portable/os-impl-posix-io.c @@ -138,7 +138,7 @@ int32 OS_GenericSeek_Impl(const OS_object_token_t *token, int32 offset, uint32 w * Use a different error code to differentiate from an * error involving a bad whence/offset */ - retval = OS_ERR_NOT_IMPLEMENTED; + retval = OS_ERR_OPERATION_NOT_SUPPORTED; } else { diff --git a/src/unit-test-coverage/portable/src/coveragetest-posix-io.c b/src/unit-test-coverage/portable/src/coveragetest-posix-io.c index f3c7ea87b..63fa89577 100644 --- a/src/unit-test-coverage/portable/src/coveragetest-posix-io.c +++ b/src/unit-test-coverage/portable/src/coveragetest-posix-io.c @@ -84,7 +84,7 @@ void Test_OS_GenericSeek_Impl(void) /* The seek implementation also checks for this specific pipe errno */ OCS_errno = OCS_ESPIPE; - OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (&token, 0, OS_SEEK_END), OS_ERR_NOT_IMPLEMENTED); + OSAPI_TEST_FUNCTION_RC(OS_GenericSeek_Impl, (&token, 0, OS_SEEK_END), OS_ERR_OPERATION_NOT_SUPPORTED); } void Test_OS_GenericRead_Impl(void)