Skip to content

Commit

Permalink
Merge pull request #268 from eriksjolund/set-errno-for-unknown-format
Browse files Browse the repository at this point in the history
writer: Set errno for unknown format
  • Loading branch information
cgwalters authored Mar 25, 2024
2 parents fc9a526 + 09ca740 commit 301b78f
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 301b78f

Please sign in to comment.