error.c
author tomas@localhost
Thu, 01 Nov 2007 14:46:11 +0100
changeset 0 c045670f36e9
permissions -rw-r--r--
Imported queue-fix-1.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     1
#include <errno.h>
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     2
#include "error.h"
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     3
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     4
/* warning: as coverage improves here, should update error_{str,temp} */
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     5
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     6
int error_intr =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     7
#ifdef EINTR
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     8
EINTR;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     9
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    10
-1;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    11
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    12
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    13
int error_nomem =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    14
#ifdef ENOMEM
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    15
ENOMEM;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    16
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    17
-2;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    18
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    19
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    20
int error_noent = 
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    21
#ifdef ENOENT
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    22
ENOENT;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    23
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    24
-3;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    25
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    26
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    27
int error_txtbsy =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    28
#ifdef ETXTBSY
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    29
ETXTBSY;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    30
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    31
-4;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    32
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    33
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    34
int error_io =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    35
#ifdef EIO
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    36
EIO;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    37
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    38
-5;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    39
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    40
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    41
int error_exist =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    42
#ifdef EEXIST
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    43
EEXIST;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    44
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    45
-6;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    46
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    47
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    48
int error_timeout =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    49
#ifdef ETIMEDOUT
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    50
ETIMEDOUT;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    51
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    52
-7;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    53
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    54
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    55
int error_inprogress =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    56
#ifdef EINPROGRESS
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    57
EINPROGRESS;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    58
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    59
-8;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    60
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    61
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    62
int error_wouldblock =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    63
#ifdef EWOULDBLOCK
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    64
EWOULDBLOCK;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    65
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    66
-9;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    67
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    68
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    69
int error_again =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    70
#ifdef EAGAIN
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    71
EAGAIN;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    72
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    73
-10;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    74
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    75
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    76
int error_pipe =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    77
#ifdef EPIPE
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    78
EPIPE;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    79
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    80
-11;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    81
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    82
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    83
int error_perm =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    84
#ifdef EPERM
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    85
EPERM;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    86
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    87
-12;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    88
#endif
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    89
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    90
int error_acces =
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    91
#ifdef EACCES
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    92
EACCES;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    93
#else
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    94
-13;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    95
#endif