]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Move adu_strerror() to adu.c.
authorAndre Noll <maan@systemlinux.org>
Sat, 18 Aug 2012 14:28:18 +0000 (16:28 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 11 Aug 2014 14:17:52 +0000 (16:17 +0200)
This function is a bit too large to be inlined, and it depends on osl.

adu.c
error.h

diff --git a/adu.c b/adu.c
index 0cd1644c236c17908656eb25c24c12084b7c9967..7d133d619836e3340e5bce2f6b2b3bf83b39d789 100644 (file)
--- a/adu.c
+++ b/adu.c
@@ -125,6 +125,25 @@ __printf_2_3 void __log(int ll, const char* fmt,...)
        va_end(argp);
 }
 
        va_end(argp);
 }
 
+/**
+ * adu's version of strerror(3).
+ *
+ * \param num The error number.
+ *
+ * \return The error text of \a num.
+ */
+const char *adu_strerror(int num)
+{
+       assert(num > 0);
+       if (num == E_OSL) {
+               assert(osl_errno > 0);
+               return osl_strerror((osl_errno));
+       }
+       if (IS_SYSTEM_ERROR(num))
+               return strerror((num) & ((1 << SYSTEM_ERROR_BIT) - 1));
+       return adu_errlist[num];
+}
+
 static void close_dir_table(void)
 {
        int ret;
 static void close_dir_table(void)
 {
        int ret;
diff --git a/error.h b/error.h
index 9849916c13446fb05da69f6c7b7ddada2fe0dae3..b37ba781936a5bb7fadc9be7c6e022bb21ae77ad 100644 (file)
--- a/error.h
+++ b/error.h
@@ -75,25 +75,7 @@ extern int osl_errno;
 /** Contains the description of all adu error codes. */
 extern char *adu_errlist[];
 
 /** Contains the description of all adu error codes. */
 extern char *adu_errlist[];
 
-
-/**
- * adu's version of strerror(3).
- *
- * \param num The error number.
- *
- * \return The error text of \a num.
- */
-_static_inline_ const char *adu_strerror(int num)
-{
-       assert(num > 0);
-       if (num == E_OSL) {
-               assert(osl_errno > 0);
-               return osl_strerror((osl_errno));
-       }
-       if (IS_SYSTEM_ERROR(num))
-               return strerror((num) & ((1 << SYSTEM_ERROR_BIT) - 1));
-       return adu_errlist[num];
-}
+extern const char *adu_strerror(int num);
 
 /**
  * Wrapper for osl library calls.
 
 /**
  * Wrapper for osl library calls.