Skip to content

Commit

Permalink
writer: Set errno for unknown format
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
  • Loading branch information
eriksjolund committed Mar 25, 2024
1 parent fc9a526 commit 09ca740
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libcomposefs/lcfs-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static struct lcfs_ctx_s *lcfs_new_ctx(struct lcfs_node_s *root,
break;

default:
errno = EINVAL;
ret = NULL;
}

Expand All @@ -101,6 +102,7 @@ static struct lcfs_ctx_s *lcfs_new_ctx(struct lcfs_node_s *root,
ret->fsverity_ctx = lcfs_fsverity_context_new();
if (ret->fsverity_ctx == NULL) {
lcfs_close(ret);
errno = ENOMEM;
return NULL;
}
}
Expand Down Expand Up @@ -377,7 +379,6 @@ int lcfs_write_to(struct lcfs_node_s *root, struct lcfs_write_options_s *options

ctx = lcfs_new_ctx(root, options);
if (ctx == NULL) {
errno = ENOMEM;
return -1;
}

Expand Down

0 comments on commit 09ca740

Please sign in to comment.