]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - error.h
Implement afs events.
[paraslash.git] / error.h
diff --git a/error.h b/error.h
index 62540f4fcf78ba0a086390859077e2f74e8fba0c..a3f80bb9674f470daef6ef6f3b49dc318984d79c 100644 (file)
--- a/error.h
+++ b/error.h
@@ -97,8 +97,6 @@ extern const char **para_errlist[];
 
 #define ATTRIBUTE_ERRORS \
        PARA_ERROR(ATTR_SYNTAX, "attribute syntax error"), \
-       PARA_ERROR(ATTR_EXISTS, "attribute already exists"), \
-       PARA_ERROR(ATTR_TABLE_FULL, "attribute table full"), \
        PARA_ERROR(NO_ATTRIBUTES, "no attributes defined yet"), \
 
 #define BLOB_ERRORS \
@@ -109,6 +107,7 @@ extern const char **para_errlist[];
 #define PLAYLIST_ERRORS \
        PARA_ERROR(NO_PLAYLIST, "no valid playlist found"), \
        PARA_ERROR(PLAYLIST_LOADED, ""), /* not really an error */ \
+       PARA_ERROR(PATH_FOUND, ""), /* not really an error */ \
        PARA_ERROR(PLAYLIST_EMPTY, "attempted to load empty playlist"), \
 
 
@@ -264,8 +263,6 @@ extern const char **para_errlist[];
 #define SIGNAL_ERRORS \
        PARA_ERROR(SIGNAL_SIG_ERR, "signal() retured SIG_ERR"), \
        PARA_ERROR(SIGNAL_READ, "read error from signal pipe"), \
-       PARA_ERROR(WAITPID, "waitpid error"), \
-       PARA_ERROR(SIGNAL_PIPE, "failed to setup signal pipe"), \
 
 
 #define STRING_ERRORS \
@@ -408,18 +405,8 @@ extern const char **para_errlist[];
 
 
 #define FD_ERRORS \
-       PARA_ERROR(NOTDIR, "error: not a directory"), \
        PARA_ERROR(FGETS, "fgets error"), \
-       PARA_ERROR(EXIST, "file or directory already exists"), \
-       PARA_ERROR(ISDIR, "error: is a directory"), \
-       PARA_ERROR(NOENT, "no such file or directory"), \
-       PARA_ERROR(OPEN_PERM, "open error (permission denied)"), \
-       PARA_ERROR(MKDIR_PERM, "mkdir error (permission denied)"), \
-       PARA_ERROR(MKDIR, "failed to create directory"), \
        PARA_ERROR(CHDIR, "failed to change directory"), \
-       PARA_ERROR(FCHDIR, "fchdir failed"), \
-       PARA_ERROR(OPENDIR, "can not open directory"), \
-       PARA_ERROR(NOSPC, "no space left on device"), \
        PARA_ERROR(OPEN, "failed to open file"), \
        PARA_ERROR(CHDIR_PERM, "insufficient permissions to chdir"), \
 
@@ -520,7 +507,11 @@ extern const char **para_errlist[];
 
 #define ERRNO_TO_PARA_ERROR(num) ((num) | (1 << SYSTEM_ERROR_BIT))
 
-#define IS_SYSTEM_ERRNO(val, _errno) (ERRNO_TO_PARA_ERROR(_errno) == (val))
+static inline int is_errno(int val, int _errno)
+{
+       assert(val > 0 && _errno > 0);
+       return ERRNO_TO_PARA_ERROR(_errno) == val;
+}
 
 /**
  * paraslash's version of strerror(3)