LCOV - code coverage report
Current view: top level - aws-c-common/include/aws/common/posix - common.inl (source / functions) Hit Total Coverage
Test: all_fuzz.info Lines: 0 18 0.0 %
Date: 2021-04-23 16:28:21 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /**
       2             :  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
       3             :  * SPDX-License-Identifier: Apache-2.0.
       4             :  */
       5             : 
       6             : #ifndef AWS_COMMON_POSIX_COMMON_INL
       7             : #define AWS_COMMON_POSIX_COMMON_INL
       8             : 
       9             : #include <aws/common/common.h>
      10             : 
      11             : #include <errno.h>
      12             : 
      13             : AWS_EXTERN_C_BEGIN
      14             : 
      15           0 : static inline int aws_private_convert_and_raise_error_code(int error_code) {
      16           0 :     switch (error_code) {
      17           0 :         case 0:
      18           0 :             return AWS_OP_SUCCESS;
      19           0 :         case EINVAL:
      20           0 :             return aws_raise_error(AWS_ERROR_MUTEX_NOT_INIT);
      21           0 :         case EBUSY:
      22           0 :             return aws_raise_error(AWS_ERROR_MUTEX_TIMEOUT);
      23           0 :         case EPERM:
      24           0 :             return aws_raise_error(AWS_ERROR_MUTEX_CALLER_NOT_OWNER);
      25           0 :         case ENOMEM:
      26           0 :             return aws_raise_error(AWS_ERROR_OOM);
      27           0 :         case EDEADLK:
      28           0 :             return aws_raise_error(AWS_ERROR_THREAD_DEADLOCK_DETECTED);
      29           0 :         default:
      30           0 :             return aws_raise_error(AWS_ERROR_MUTEX_FAILED);
      31           0 :     }
      32           0 : }
      33             : 
      34             : AWS_EXTERN_C_END
      35             : 
      36             : #endif /* AWS_COMMON_POSIX_COMMON_INL */

Generated by: LCOV version 1.13