Commit 7cee8789 by Michel Normand Committed by Daniel Lezcano

remove lxc_error_t enum that is now useless

There is no more need of the LXC_ERROR defines and related lxc_strerror function. Signed-off-by: 's avatarMichel Normand <normand@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 95b5ffaf
...@@ -29,49 +29,6 @@ ...@@ -29,49 +29,6 @@
lxc_log_define(lxc_error, lxc); lxc_log_define(lxc_error, lxc);
static const char *const catalogue[] = {
[LXC_ERROR_LOCK] = "Failed to lock the container",
[LXC_ERROR_ESRCH] = "The container is empty",
[LXC_ERROR_EEXIST] = "The container already exists",
[LXC_ERROR_EBUSY] = "The container is busy",
[LXC_ERROR_ENOENT] = "The container was not found",
[LXC_ERROR_EACCES] = "Not enough privilege to use the container",
[LXC_ERROR_WRONG_COMMAND] = "Wrong command",
[LXC_ERROR_CONF_CGROUP] = "Failed to configure the control group",
[LXC_ERROR_CONF_MOUNT] = "Failed to configure the mount points",
[LXC_ERROR_CONF_UTSNAME] = "Failed to configure the utsname",
[LXC_ERROR_CONF_NETWORK] = "Failed to configure the network",
[LXC_ERROR_CONF_TTY] = "Failed to configure the tty",
[LXC_ERROR_CONF_ROOTFS] = "Failed to configure the root fs",
[LXC_ERROR_CONF_PTS] = "Failed to configure the pts",
[LXC_ERROR_SETUP_CGROUP] = "Failed to setup the control group",
[LXC_ERROR_SETUP_MOUNT] = "Failed to setup the mount points",
[LXC_ERROR_SETUP_UTSNAME] = "Failed to setup the utsname",
[LXC_ERROR_SETUP_NETWORK] = "Failed to setup the network",
[LXC_ERROR_SETUP_CONSOLE] = "Failed to setup the console",
[LXC_ERROR_SETUP_TTY] = "Failed to setup the tty",
[LXC_ERROR_SETUP_ROOTFS] = "Failed to setup the root fs",
[LXC_ERROR_SETUP_PTS] = "Failed to setup the new pts instance",
[LXC_ERROR_TTY_DENIED] = "tty service denied",
[LXC_ERROR_TTY_EAGAIN] = "tty service is not available",
[LXC_ERROR_INTERNAL] = "Internal system error",
};
const char *const lxc_strerror(int error)
{
error = abs(error);
if (error >= LXC_LAST_ERROR)
return NULL;
return catalogue[error];
}
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* lxc_error_set_and_log /* lxc_error_set_and_log
* function is here to convert * function is here to convert
......
...@@ -23,41 +23,6 @@ ...@@ -23,41 +23,6 @@
#ifndef __lxc_error_h #ifndef __lxc_error_h
#define __lxc_error_h #define __lxc_error_h
typedef enum {
LXC_SUCCESS, /* 0 == success ;) */
LXC_ERROR_LOCK,
LXC_ERROR_ESRCH,
LXC_ERROR_EEXIST,
LXC_ERROR_EBUSY,
LXC_ERROR_ENOENT,
LXC_ERROR_EACCES,
LXC_ERROR_WRONG_COMMAND,
LXC_ERROR_CONF_CGROUP,
LXC_ERROR_CONF_MOUNT,
LXC_ERROR_CONF_UTSNAME,
LXC_ERROR_CONF_NETWORK,
LXC_ERROR_CONF_TTY,
LXC_ERROR_CONF_ROOTFS,
LXC_ERROR_CONF_PTS,
LXC_ERROR_SETUP_CGROUP,
LXC_ERROR_SETUP_MOUNT,
LXC_ERROR_SETUP_UTSNAME,
LXC_ERROR_SETUP_NETWORK,
LXC_ERROR_SETUP_CONSOLE,
LXC_ERROR_SETUP_TTY,
LXC_ERROR_SETUP_ROOTFS,
LXC_ERROR_SETUP_PTS,
LXC_ERROR_TTY_DENIED,
LXC_ERROR_TTY_EAGAIN,
LXC_ERROR_INTERNAL,
LXC_LAST_ERROR,
} lxc_error_t;
extern int lxc_error_set_and_log(int pid, int status); extern int lxc_error_set_and_log(int pid, int status);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment