diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-04-05 21:12:29 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-04-05 21:12:29 +0000 |
commit | 775d07093eb7dc5701457147a8404f0eae443538 (patch) | |
tree | 65c99eaf5f048beaa6a7d9973eb8410048b1f15d /lib/libarchive/archive_read_open_file.c | |
parent | 74cf37bd00b1e09a0b991b7b1edd335d8e0c2355 (diff) | |
download | FreeBSD-src-775d07093eb7dc5701457147a8404f0eae443538.zip FreeBSD-src-775d07093eb7dc5701457147a8404f0eae443538.tar.gz |
Overhauled ACL support. This makes us compatible
with 'star' ACL handling, though there's still a
bit more work needed in this area.
Added 'write_open_fd' and 'read_open_fd' to simplify, e.g.,
tar's u and r modes. Eliminated old 'write_open_file_position'
as a bad idea. (It required closing/reopening files to
do updates, which led to unpleasant implications.)
Various other minor fixes, API tweaks, etc.
Diffstat (limited to 'lib/libarchive/archive_read_open_file.c')
-rw-r--r-- | lib/libarchive/archive_read_open_file.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_open_file.c b/lib/libarchive/archive_read_open_file.c index a07ff29..772e1cc 100644 --- a/lib/libarchive/archive_read_open_file.c +++ b/lib/libarchive/archive_read_open_file.c @@ -55,12 +55,19 @@ archive_read_open_file(struct archive *a, const char *filename, { struct read_file_data *mine; - /* XXX detect and report malloc failure XXX */ if (filename == NULL) { mine = malloc(sizeof(*mine)); + if (mine == NULL) { + archive_set_error(a, ENOMEM, "No memory"); + return (ARCHIVE_FATAL); + } mine->filename[0] = 0; } else { mine = malloc(sizeof(*mine) + strlen(filename)); + if (mine == NULL) { + archive_set_error(a, ENOMEM, "No memory"); + return (ARCHIVE_FATAL); + } strcpy(mine->filename, filename); } mine->block_size = block_size; |