ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/error.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/error.c (file contents):
Revision 1.12 by tdb, Fri Jul 16 15:07:14 2004 UTC vs.
Revision 1.13 by tdb, Fri Jul 16 15:28:02 2004 UTC

# Line 35 | Line 35
35   static sg_error error = SG_ERROR_NONE;
36   #define ERROR_ARG_MAX 256
37   static char error_arg[ERROR_ARG_MAX];
38 < static char error_strerror[ERROR_ARG_MAX];
38 > static int errno_value = 0;
39  
40   void sg_set_error(sg_error code, const char *arg) {
41          error = code;
# Line 48 | Line 48 | void sg_set_error(sg_error code, const char *arg) {
48          }
49   }
50  
51 < void sg_set_error_with_errno(sg_error code, const char *arg, int use_errno) {
52 <        if(use_errno) {
53 <                sg_strlcpy(error_strerror, strerror(errno), sizeof error_strerror);
54 <        }
55 <        else {
56 <                /* FIXME is this the best idea? */
57 <                error_strerror[0] = '\0';
58 <        }
51 > void sg_set_error_with_errno(sg_error code, const char *arg) {
52 >        errno_value = errno;
53          sg_set_error(code, arg);
54   }
55  
# Line 67 | Line 61 | const char *sg_get_error_arg() {
61          return error_arg;
62   }
63  
64 < const char *sg_get_error_strerror() {
65 <        return error_strerror;
64 > const int sg_get_error_errno() {
65 >        return errno_value;
66   }
67  
68   const char *sg_str_error(sg_error code) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines