2020-06-16 21:39:45 +00:00
|
|
|
#include "webfuse_provider/impl/status_intern.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
int wfp_status_to_rc(wfp_status status)
|
2019-03-26 22:04:53 +00:00
|
|
|
{
|
|
|
|
switch(status)
|
|
|
|
{
|
2020-06-16 21:57:41 +00:00
|
|
|
case WFP_GOOD: return 0;
|
|
|
|
case WFP_BAD_NOTIMPLEMENTED: return -ENOSYS;
|
|
|
|
case WFP_BAD_TIMEOUT: return -ETIMEDOUT;
|
|
|
|
case WFP_BAD_BUSY: return -ENOENT;
|
|
|
|
case WFP_BAD_FORMAT: return -ENOENT;
|
|
|
|
case WFP_BAD_NOENTRY: return -ENOENT;
|
|
|
|
case WFP_BAD_ACCESS_DENIED: return -EACCES;
|
2019-03-26 22:04:53 +00:00
|
|
|
default: return -ENOENT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
char const * wfp_status_tostring(wfp_status status)
|
2019-03-26 22:04:53 +00:00
|
|
|
{
|
|
|
|
switch(status)
|
|
|
|
{
|
2020-06-16 21:57:41 +00:00
|
|
|
case WFP_GOOD: return "Good";
|
|
|
|
case WFP_BAD: return "Bad";
|
|
|
|
case WFP_BAD_NOTIMPLEMENTED: return "Bad (not implemented)";
|
|
|
|
case WFP_BAD_TIMEOUT: return "Bad (timeout)";
|
|
|
|
case WFP_BAD_BUSY: return "Bad (busy)";
|
|
|
|
case WFP_BAD_FORMAT: return "Bad (format)";
|
|
|
|
case WFP_BAD_NOENTRY: return "Bad (no entry)";
|
|
|
|
case WFP_BAD_ACCESS_DENIED: return "Bad (access denied)";
|
2019-03-26 22:04:53 +00:00
|
|
|
default: return "Bad (unknown)";
|
|
|
|
}
|
|
|
|
}
|