]> wimlib.net Git - wimlib/commitdiff
inode.c: make inode_add_stream_with_data() return the new stream
authorEric Biggers <ebiggers3@gmail.com>
Mon, 26 Dec 2016 21:14:40 +0000 (15:14 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 27 Dec 2016 03:15:13 +0000 (21:15 -0600)
include/wimlib/inode.h
src/inode.c

index 7652ef525a351c61f21069f303efd5ed3989fec8..9fc917b57165a24c324c301456c1038a165b698e 100644 (file)
@@ -359,7 +359,7 @@ inode_replace_stream_data(struct wim_inode *inode,
                          const void *data, size_t size,
                          struct blob_table *blob_table);
 
-extern bool
+extern struct wim_inode_stream *
 inode_add_stream_with_data(struct wim_inode *inode,
                           int stream_type, const utf16lechar *stream_name,
                           const void *data, size_t size,
index 034b9a11f3ec1d70b58df2f3a4eef1af147b2355..c5fcbbbe3e4617c17a3f6b7c6612321029227a70 100644 (file)
@@ -371,9 +371,10 @@ inode_replace_stream_data(struct wim_inode *inode,
  * @blob_table
  *     Pointer to the blob table in which data blobs are being indexed
  *
- * Returns true if successful; false with errno set if unsuccessful.
+ * Returns a pointer to the new stream, or NULL with errno set if it could not
+ * be added.
  */
-bool
+struct wim_inode_stream *
 inode_add_stream_with_data(struct wim_inode *inode,
                           int stream_type, const utf16lechar *stream_name,
                           const void *data, size_t size,
@@ -384,18 +385,18 @@ inode_add_stream_with_data(struct wim_inode *inode,
 
        strm = inode_add_stream(inode, stream_type, stream_name, NULL);
        if (!strm)
-               return false;
+               return NULL;
 
        if (size) {
                blob = new_blob_from_data_buffer(data, size, blob_table);
                if (unlikely(!blob)) {
                        inode_remove_stream(inode, strm, blob_table);
-                       return false;
+                       return NULL;
                }
        }
 
        inode_set_stream_blob(inode, strm, blob);
-       return true;
+       return strm;
 }
 
 /*