21 lines
348 B
C
21 lines
348 B
C
#include "status.h"
|
|
|
|
#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;
|
|
}
|
|
}
|