mirror of
https://github.com/curl/curl.git
synced 2025-03-01 15:15:34 +08:00
parent
3b0eb3cd5c
commit
0c667188e0
12
lib/fopen.c
12
lib/fopen.c
@ -56,13 +56,13 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,
|
||||
int fd = -1;
|
||||
*tempname = NULL;
|
||||
|
||||
if(stat(filename, &sb) == -1 || !S_ISREG(sb.st_mode)) {
|
||||
/* a non-regular file, fallback to direct fopen() */
|
||||
*fh = fopen(filename, FOPEN_WRITETEXT);
|
||||
if(*fh)
|
||||
return CURLE_OK;
|
||||
*fh = fopen(filename, FOPEN_WRITETEXT);
|
||||
if(!*fh)
|
||||
goto fail;
|
||||
}
|
||||
if(fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode))
|
||||
return CURLE_OK;
|
||||
fclose(*fh);
|
||||
*fh = NULL;
|
||||
|
||||
result = Curl_rand_hex(data, randsuffix, sizeof(randsuffix));
|
||||
if(result)
|
||||
|
Loading…
Reference in New Issue
Block a user