[easytag/wip/application-window: 21/25] Add a comment about id3_file_fdopen()



commit f67258df155355ce57f807af97e41acd5292ee45
Author: David King <amigadave amigadave com>
Date:   Mon Feb 3 16:28:23 2014 +0000

    Add a comment about id3_file_fdopen()
    
    Passing a file descriptor to id3_file_fdopen() causes it to take
    ownership of the descriptor, so that only a matching id3_file_close() is
    required to close the resulting file.
    
    Found with Coverity.

 src/id3v24_tag.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/id3v24_tag.c b/src/id3v24_tag.c
index c02d08c..5d7bbcd 100644
--- a/src/id3v24_tag.c
+++ b/src/id3v24_tag.c
@@ -191,6 +191,7 @@ gboolean Id3tag_Read_File_Tag (const gchar *filename, File_Tag *FileTag)
 
     g_free(string1);
 
+    /* Takes ownership of the file descriptor on success. */
     if ((file = id3_file_fdopen(tmpfile, ID3_FILE_MODE_READONLY)) == NULL)
     {
         close(tmpfile);


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