diff options
author | Yang Tse <yangsita@gmail.com> | 2007-02-16 16:01:19 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-02-16 16:01:19 +0000 |
commit | 4894ce16fc7af89d876e2f70db4dded7e1663198 (patch) | |
tree | 87d862afccc642c48f55d7549160859401b3face /src | |
parent | aa4435c23b008450124d8c015e896d1002cb93ca (diff) |
use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handling
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index d0b885151..e06582f09 100644 --- a/src/main.c +++ b/src/main.c @@ -1319,11 +1319,11 @@ static int str2offset(curl_off_t *val, char *str) /* this is a duplicate of the function that is also used in libcurl */ *val = curlx_strtoofft(str, NULL, 0); - if ((*val == LLONG_MAX || *val == LLONG_MIN) && errno == ERANGE) + if ((*val == LLONG_MAX || *val == LLONG_MIN) && ERRNO == ERANGE) return 1; #else *val = strtol(str, NULL, 0); - if ((*val == LONG_MIN || *val == LONG_MAX) && errno == ERANGE) + if ((*val == LONG_MIN || *val == LONG_MAX) && ERRNO == ERANGE) return 1; #endif return 0; @@ -4621,6 +4621,7 @@ static int create_dir_hierarchy(char *outfile) char *outdup; char *dirbuildup; int result=0; + int error; outdup = strdup(outfile); dirbuildup = malloc(sizeof(char) * strlen(outfile)); @@ -4646,7 +4647,8 @@ static int create_dir_hierarchy(char *outfile) if (access(dirbuildup, F_OK) == -1) { result = mkdir(dirbuildup,(mode_t)0000750); if (-1 == result) { - switch (errno) { + error = ERRNO; + switch (error) { #ifdef EACCES case EACCES: fprintf(stderr,"You don't have permission to create %s.\n", |