2019-03-26 22:04:53 +00:00
|
|
|
#include "webfuse/core/status_intern.h"
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
int wf_status_to_rc(wf_status status)
|
|
|
|
{
|
|
|
|
switch(status)
|
|
|
|
{
|
|
|
|
case WF_GOOD: return 0;
|
|
|
|
case WF_BAD_NOTIMPLEMENTED: return -ENOSYS;
|
|
|
|
case WF_BAD_TIMEOUT: return -ETIMEDOUT;
|
|
|
|
case WF_BAD_BUSY: return -ENOENT;
|
|
|
|
case WF_BAD_FORMAT: return -ENOENT;
|
|
|
|
case WF_BAD_NOENTRY: return -ENOENT;
|
2019-04-01 20:15:12 +00:00
|
|
|
case WF_BAD_ACCESS_DENIED: return -EACCES;
|
2019-03-26 22:04:53 +00:00
|
|
|
default: return -ENOENT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
char const * wf_status_tostring(wf_status status)
|
|
|
|
{
|
|
|
|
switch(status)
|
|
|
|
{
|
|
|
|
case WF_GOOD: return "Good";
|
|
|
|
case WF_BAD: return "Bad";
|
2019-05-19 12:33:42 +00:00
|
|
|
case WF_BAD_NOTIMPLEMENTED: return "Bad (not implemented)";
|
2019-03-26 22:04:53 +00:00
|
|
|
case WF_BAD_TIMEOUT: return "Bad (timeout)";
|
|
|
|
case WF_BAD_BUSY: return "Bad (busy)";
|
|
|
|
case WF_BAD_FORMAT: return "Bad (format)";
|
|
|
|
case WF_BAD_NOENTRY: return "Bad (no entry)";
|
2019-04-01 20:15:12 +00:00
|
|
|
case WF_BAD_ACCESS_DENIED: return "Bad (access denied)";
|
2019-03-26 22:04:53 +00:00
|
|
|
default: return "Bad (unknown)";
|
|
|
|
}
|
|
|
|
}
|