X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=error.h;h=537e7393b3e038d5e380de9512c93965248d11c3;hp=62540f4fcf78ba0a086390859077e2f74e8fba0c;hb=c458b9d45e7c6ddda6285fca3797fddff815bd0a;hpb=5a5fe7330e078cd43ce9d90fe2cc67058015e6da diff --git a/error.h b/error.h index 62540f4f..537e7393 100644 --- a/error.h +++ b/error.h @@ -408,18 +408,10 @@ 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 +512,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)