[Rpm-ecosystem] [PATCH v6 01/11] Refactor copyFile to not close files

Mimi Zohar zohar at linux.vnet.ibm.com
Mon Jul 6 18:52:15 UTC 2015


From: "fin at linux.vnet.ibm.com" <fin at linux.vnet.ibm.com>

This patch refactors copyFile so that it doesn't close sfdp and tfdp,
since copyFile didn't open those files. Also, the caller to copyFile
closes these files. This patch also adds descriptions of copyFile
parameters.
---
 sign/rpmgensig.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sign/rpmgensig.c b/sign/rpmgensig.c
index 24bf39e..cf79a87 100644
--- a/sign/rpmgensig.c
+++ b/sign/rpmgensig.c
@@ -151,6 +151,10 @@ static int manageFile(FD_t *fdp, const char *fn, int flags)
 
 /**
  * Copy header+payload, calculating digest(s) on the fly.
+ * @param sfdp source file
+ * @param sfnp source path
+ * @param tfdp destination file
+ * @param tfnp destination path
  */
 static int copyFile(FD_t *sfdp, const char *sfnp,
 		FD_t *tfdp, const char *tfnp)
@@ -184,8 +188,6 @@ static int copyFile(FD_t *sfdp, const char *sfnp,
     rc = 0;
 
 exit:
-    if (*sfdp)	(void) closeFile(sfdp);
-    if (*tfdp)	(void) closeFile(tfdp);
     return rc;
 }
 
-- 
2.1.0



More information about the Rpm-ecosystem mailing list