]> git.tuebingen.mpg.de Git - dss.git/blobdiff - error.h
error.h: Remove is_errno().
[dss.git] / error.h
diff --git a/error.h b/error.h
index d54845d0253cda4cf609c2db1a8c52634ca5fa5a..ade1a8ec25ea40a0c5a9a96ee622fbfcc7583ff2 100644 (file)
--- a/error.h
+++ b/error.h
@@ -1,3 +1,8 @@
+/*
+ * Copyright (C) 2006-2010 Andre Noll <maan@systemlinux.org>
+ *
+ * Licensed under the GPL v2. For licencing details see COPYING.
+ */
 extern char *dss_errlist[];
 extern char *dss_error_txt;
 
@@ -16,20 +21,6 @@ __printf_2_3 void dss_log(int ll, const char* fmt,...);
 /** Set the system error bit for the given number. */
 #define ERRNO_TO_DSS_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 dss' 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_DSS_ERROR(_errno) == num;
-}
-
 /**
  * dss' version of strerror(3).
  *
@@ -46,11 +37,6 @@ static inline char *dss_strerror(int num)
                return dss_errlist[num];
 }
 
-static inline void log_err_msg(int loglevel, int num)
-{
-       dss_log(loglevel, "%s (%s)\n", dss_error_txt, dss_strerror(num));
-}
-
 #define DSS_ERRORS \
        DSS_ERROR(SUCCESS, "success") \
        DSS_ERROR(SYNTAX, "syntax error") \
@@ -65,7 +51,10 @@ static inline void log_err_msg(int loglevel, int num)
        DSS_ERROR(DUP_PIPE, "exec error: can not create pipe") \
        DSS_ERROR(INVOLUNTARY_EXIT, "unexpected termination cause") \
        DSS_ERROR(BAD_EXIT_CODE, "unexpected exit code") \
-       DSS_ERROR(SIGNAL_SIG_ERR, "signal() returned SIG_ERR")
+       DSS_ERROR(SIGNAL_SIG_ERR, "signal() returned SIG_ERR") \
+       DSS_ERROR(SIGNAL, "caught terminating signal") \
+       DSS_ERROR(BUG, "values of beta might cause dom!") \
+
 
 /**
  * This is temporarily defined to expand to its first argument (prefixed by