mirror of
https://github.com/moparisthebest/curl
synced 2024-12-23 16:48:49 -05:00
file: avoid duplicated code sequence
file_disconnect() is identical with file_do() except the function header but as the arguments are unused anyway so why not just return file_do() directly! Reviewed-by: Daniel Stenberg Closes #6249
This commit is contained in:
parent
920f49a20b
commit
12cb7a1fe0
12
lib/file.c
12
lib/file.c
@ -227,18 +227,8 @@ static CURLcode file_done(struct connectdata *conn,
|
|||||||
static CURLcode file_disconnect(struct connectdata *conn,
|
static CURLcode file_disconnect(struct connectdata *conn,
|
||||||
bool dead_connection)
|
bool dead_connection)
|
||||||
{
|
{
|
||||||
struct FILEPROTO *file = conn->data->req.p.file;
|
|
||||||
(void)dead_connection; /* not used */
|
(void)dead_connection; /* not used */
|
||||||
|
return file_done(conn, 0, 0);
|
||||||
if(file) {
|
|
||||||
Curl_safefree(file->freepath);
|
|
||||||
file->path = NULL;
|
|
||||||
if(file->fd != -1)
|
|
||||||
close(file->fd);
|
|
||||||
file->fd = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CURLE_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DOS_FILESYSTEM
|
#ifdef DOS_FILESYSTEM
|
||||||
|
Loading…
Reference in New Issue
Block a user