2026-05-25 10:33:29 +01:00
|
|
|
#include <bshell/status.h>
|
2026-05-07 10:52:00 +01:00
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
|
|
enum bshell_status bshell_status_from_errno(int err)
|
|
|
|
|
{
|
|
|
|
|
switch (err) {
|
|
|
|
|
case 0:
|
|
|
|
|
return BSHELL_SUCCESS;
|
|
|
|
|
case EIO:
|
|
|
|
|
return BSHELL_ERR_IO_FAILURE;
|
|
|
|
|
case ENOENT:
|
|
|
|
|
return BSHELL_ERR_NO_ENTRY;
|
|
|
|
|
case EPERM:
|
|
|
|
|
case EACCES:
|
|
|
|
|
return BSHELL_ERR_ACCESS_DENIED;
|
|
|
|
|
default:
|
|
|
|
|
return BSHELL_ERR_INTERNAL_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
}
|