version 1.32, 2021/10/29 08:00:59 |
version 1.33, 2021/11/03 14:42:12 |
|
|
*/ |
*/ |
static int |
static int |
check_file(int rootfd, const struct flist *f, struct stat *st) |
check_file(int rootfd, const struct flist *f, struct stat *st) |
{ |
{ |
if (fstatat(rootfd, f->path, st, AT_SYMLINK_NOFOLLOW) == -1) { |
if (fstatat(rootfd, f->path, st, AT_SYMLINK_NOFOLLOW) == -1) { |
if (errno == ENOENT) |
if (errno == ENOENT) |
return 3; |
return 3; |
|
|
/* Make sure the block metadata buffer is big enough. */ |
/* Make sure the block metadata buffer is big enough. */ |
|
|
u->bufsz = |
u->bufsz = |
sizeof(int32_t) + /* identifier */ |
sizeof(int32_t) + /* identifier */ |
sizeof(int32_t) + /* block count */ |
sizeof(int32_t) + /* block count */ |
sizeof(int32_t) + /* block length */ |
sizeof(int32_t) + /* block length */ |
sizeof(int32_t) + /* checksum length */ |
sizeof(int32_t) + /* checksum length */ |
sizeof(int32_t) + /* block remainder */ |
sizeof(int32_t) + /* block remainder */ |
blk.blksz * |
blk.blksz * |
(sizeof(int32_t) + /* short checksum */ |
(sizeof(int32_t) + /* short checksum */ |
blk.csum); /* long checksum */ |
blk.csum); /* long checksum */ |
|
|
if (u->bufsz > u->bufmax) { |
if (u->bufsz > u->bufmax) { |
if ((bufp = realloc(u->buf, u->bufsz)) == NULL) { |
if ((bufp = realloc(u->buf, u->bufsz)) == NULL) { |