From 155571d841effd7411686952da0d679af34bc0ac Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Thu, 27 Jan 2011 16:55:21 -0500 Subject: [PATCH] freetdm: fix ftdm error mapping to unix-style errors --- libs/freetdm/src/include/ftdm_declare.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/freetdm/src/include/ftdm_declare.h b/libs/freetdm/src/include/ftdm_declare.h index 88a76930f7..b443f2d5f5 100644 --- a/libs/freetdm/src/include/ftdm_declare.h +++ b/libs/freetdm/src/include/ftdm_declare.h @@ -178,18 +178,20 @@ typedef int ftdm_socket_t; /*! \brief FreeTDM APIs possible return codes */ typedef enum { FTDM_SUCCESS, /*!< Success */ - FTDM_FAIL, /*!< Failure, generic error return code, use ftdm_channel_get_last_error or ftdm_span_get_last_error for details */ - FTDM_MEMERR, /*!< Memory error, most likely allocation failure */ + FTDM_FAIL, /*!< Failure, generic error return code when no more specific return code can be used */ + + FTDM_MEMERR, /*!< Allocation failure */ + FTDM_ENOMEM = FTDM_MEMERR, + FTDM_TIMEOUT, /*!< Operation timed out (ie: polling on a device)*/ + FTDM_ETIMEDOUT = FTDM_TIMEOUT, + FTDM_NOTIMPL, /*!< Operation not implemented */ + FTDM_ENOSYS = FTDM_NOTIMPL, /*!< The function is not implemented */ + FTDM_BREAK, /*!< Request the caller to perform a break (context-dependant, ie: stop getting DNIS/ANI) */ /*!< Any new return codes should try to mimc unix style error codes, no need to reinvent */ - /* Remapping some of the codes that were before */ - FTDM_ENOMEM = FTDM_MEMERR, /*!< Memory error */ - FTDM_ETIMEDOUT = FTDM_TIMEOUT, /*!< Operation timedout */ - FTDM_ENOSYS = FTDM_NOTIMPL, /*!< The function is not implemented */ - FTDM_EINVAL, /*!< Invalid argument */ FTDM_ECANCELED, /*!< Operation cancelled */ FTDM_EBUSY, /*!< Device busy */