Kill error.h.
authorAndre Noll <maan@systemlinux.org>
Thu, 11 Jun 2009 21:52:20 +0000 (23:52 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 11 Jun 2009 21:52:20 +0000 (23:52 +0200)
This completes the cleanup of the error handling.

error.h [deleted file]
fsck.c
osl.c
util.c

diff --git a/error.h b/error.h
deleted file mode 100644 (file)
index f28c39d..0000000
--- a/error.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#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;
-}
diff --git a/fsck.c b/fsck.c
index e623b3789f284910c6a9b7ad6fbea5231030ed57..bd1b5567ba86c05d2f168ecf9506c8dcda7ab5f7 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -14,7 +14,6 @@
 
 #include "log.h"
 #include "osl.h"
 
 #include "log.h"
 #include "osl.h"
-#include "error.h"
 #include "util.h"
 #include "osl_core.h"
 #include "fsck.cmdline.h"
 #include "util.h"
 #include "osl_core.h"
 #include "fsck.cmdline.h"
@@ -44,6 +43,7 @@ static struct fsck_args_info conf;
        FSCK_ERROR(CHDIR, "could not change directory"), \
        FSCK_ERROR(OPENDIR, "could not open directory"),
 
        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,
 #define FSCK_ERROR(num, txt) E_FSCK_ ## num
 enum {
        FSCK_DUMMY = (1 << FSCK_ERROR_BIT) - 1,
diff --git a/osl.c b/osl.c
index eb1d24f8828676adaac023b4c458a37a1f485c2a..5b9308e4bec25185134724a10fe3d8eb2023d84d 100644 (file)
--- a/osl.c
+++ b/osl.c
@@ -10,7 +10,6 @@
 
 #include "log.h"
 #include "osl.h"
 
 #include "log.h"
 #include "osl.h"
-#include "error.h"
 #include "util.h"
 #include "osl_core.h"
 
 #include "util.h"
 #include "osl_core.h"
 
@@ -38,8 +37,6 @@ static const unsigned int errmsgidx[] = {
 
 __export const char *osl_strerror(int num)
 {
 
 __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];
 }
 
        return msgstr.str + errmsgidx[num];
 }
 
diff --git a/util.c b/util.c
index 79b49445d7c602601e4b18e00ee99450dd5bc2c9..7500c08b2a6f085f4acc4fc77efc985a4351d977 100644 (file)
--- a/util.c
+++ b/util.c
@@ -14,7 +14,6 @@
 
 #include "log.h"
 #include "osl.h"
 
 #include "log.h"
 #include "osl.h"
-#include "error.h"
 #include "util.h"
 
 /**
 #include "util.h"
 
 /**