mirror of
https://github.com/pumpitupdev/pumptools.git
synced 2024-11-24 07:00:09 +01:00
capnhook/result: Extend error code list
This commit is contained in:
parent
fb69d87c15
commit
6492e4df1a
@ -47,6 +47,8 @@ int cnh_result_to_errno(enum cnh_result result)
|
||||
return EPIPE;
|
||||
case CNH_RESULT_TIMER_EXPIRED:
|
||||
return ETIME;
|
||||
case CNH_RESULT_NO_DATA_AVAILABLE:
|
||||
return ENODATA;
|
||||
default:
|
||||
log_warn("Unhandled other error %d to errno convert might cause bugs", result);
|
||||
return EIO;
|
||||
@ -92,6 +94,8 @@ enum cnh_result cnh_errno_to_result(int errn)
|
||||
return CNH_RESULT_BROKEN_PIPE;
|
||||
case ETIME:
|
||||
return CNH_RESULT_TIMER_EXPIRED;
|
||||
case ENODATA:
|
||||
return CNH_RESULT_NO_DATA_AVAILABLE;
|
||||
default:
|
||||
log_warn("Unhandled errno to general error convert might cause bugs, errno: %d", errn);
|
||||
return CNH_RESULT_OTHER_ERROR;
|
||||
|
@ -31,6 +31,7 @@ enum cnh_result {
|
||||
CNH_RESULT_NO_SUCH_DEVICE_OR_ADDRESS = 17,
|
||||
CNH_RESULT_BROKEN_PIPE = 18,
|
||||
CNH_RESULT_TIMER_EXPIRED = 19,
|
||||
CNH_RESULT_NO_DATA_AVAILABLE = 20,
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user