From 4894ce16fc7af89d876e2f70db4dded7e1663198 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 16 Feb 2007 16:01:19 +0000 Subject: use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handling --- src/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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", -- cgit v1.2.3