+++ /dev/null
-#define FSCK_ERROR_BIT 29
-/**
- * This bit indicates whether a number is considered a system error number
- * If yes, the system errno is just the result of clearing this bit from
- * the given number.
- */
-#define SYSTEM_ERROR_BIT 30
-
-/** Check whether the system error bit is set. */
-#define IS_SYSTEM_ERROR(num) (!!((num) & (1 << SYSTEM_ERROR_BIT)))
-
-/** Set the system error bit for the given number. */
-#define ERRNO_TO_ERROR(num) ((num) | (1 << SYSTEM_ERROR_BIT))
-
-/**
- * Check whether a given number is a system error number.
- *
- * \param num The value to be checked.
- * \param _errno The system error number.
- *
- * \return True if \a num is the representation of the system
- * error identified by \a _errno.
- */
-static inline int is_errno(int num, int _errno)
-{
- assert(num > 0 && _errno > 0);
- return ERRNO_TO_ERROR(_errno) == num;
-}
#include "log.h"
#include "osl.h"
-#include "error.h"
#include "util.h"
#include "osl_core.h"
#include "fsck.cmdline.h"
FSCK_ERROR(CHDIR, "could not change directory"), \
FSCK_ERROR(OPENDIR, "could not open directory"),
+#define FSCK_ERROR_BIT 29
#define FSCK_ERROR(num, txt) E_FSCK_ ## num
enum {
FSCK_DUMMY = (1 << FSCK_ERROR_BIT) - 1,
#include "log.h"
#include "osl.h"
-#include "error.h"
#include "util.h"
#include "osl_core.h"
__export const char *osl_strerror(int num)
{
- if (IS_SYSTEM_ERROR(num))
- return strerror((num) & ((1 << SYSTEM_ERROR_BIT) - 1));
return msgstr.str + errmsgidx[num];
}