gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 372/411: file: avoid duplicated code sequence


From: gnunet
Subject: [gnurl] 372/411: file: avoid duplicated code sequence
Date: Wed, 13 Jan 2021 01:23:07 +0100

This is an automated email from the git hooks/post-receive script.

nikita pushed a commit to branch master
in repository gnurl.

commit 12cb7a1fe0282cc0b1ef4faa6013a2de03028aac
Author: Emil Engler <me@emilengler.com>
AuthorDate: Wed Nov 25 18:26:56 2020 +0100

    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
---
 lib/file.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/lib/file.c b/lib/file.c
index 5f06c4cca..a65eb7798 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -227,18 +227,8 @@ static CURLcode file_done(struct connectdata *conn,
 static CURLcode file_disconnect(struct connectdata *conn,
                                 bool dead_connection)
 {
-  struct FILEPROTO *file = conn->data->req.p.file;
   (void)dead_connection; /* not used */
-
-  if(file) {
-    Curl_safefree(file->freepath);
-    file->path = NULL;
-    if(file->fd != -1)
-      close(file->fd);
-    file->fd = -1;
-  }
-
-  return CURLE_OK;
+  return file_done(conn, 0, 0);
 }
 
 #ifdef DOS_FILESYSTEM

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]