]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
error.h: Remove is_errno().
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 10 Aug 2015 17:34:45 +0000 (19:34 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 27 Sep 2015 13:25:39 +0000 (13:25 +0000)
There is only one caller of is_errno() which is converted to use
ERRNO_TO_PARA_ERROR() in this patch.

afs.c
error.h

diff --git a/afs.c b/afs.c
index 299d65ebd287cf7fe1122fab1c25b37cb9a02360..c40537466fd9480265815d034050b745dc2f45d3 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -678,7 +678,7 @@ static int make_database_dir(void)
 
        get_database_dir();
        ret = para_mkdir(database_dir, 0777);
 
        get_database_dir();
        ret = para_mkdir(database_dir, 0777);
-       if (ret >= 0 || is_errno(-ret, EEXIST))
+       if (ret >= 0 || ret == -ERRNO_TO_PARA_ERROR(EEXIST))
                return 1;
        return ret;
 }
                return 1;
        return ret;
 }
diff --git a/error.h b/error.h
index 3818b1106ced60356e065ac8669523d1afb2808d..27e9e264ba10206e9218ac25013f63f04bc821ec 100644 (file)
--- a/error.h
+++ b/error.h
@@ -578,20 +578,6 @@ extern const char **para_errlist[];
 /** Set the osl error bit for the given number. */
 #define OSL_ERRNO_TO_PARA_ERROR(num) ((num) | (1 << OSL_ERROR_BIT))
 
 /** Set the osl error bit for the given number. */
 #define OSL_ERRNO_TO_PARA_ERROR(num) ((num) | (1 << OSL_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 paraslash's representation of the system
- * error identified by \a _errno.
- */
-_static_inline_ bool is_errno(int num, int _errno)
-{
-       assert(num > 0 && _errno > 0);
-       return ERRNO_TO_PARA_ERROR(_errno) == num;
-}
-
 /**
  * Paraslash's version of strerror(3).
  *
 /**
  * Paraslash's version of strerror(3).
  *