Skip to content

Commit

Permalink
Man page, Thread count validation
Browse files Browse the repository at this point in the history
Signed-off-by: divin <[email protected]>
  • Loading branch information
divineaugustine committed Mar 28, 2024
1 parent c6246a9 commit d833f84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions man/mkcomposefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ will be a mountable composefs image.
actual image format version used will be adjusted upwards if that
is beneficial for the image, up to the max version.

**\-\-threads**
: Number of threads to be used to calculate the file digests and copy.

# FORMAT VERSIONING

Composefs images are binary reproduceable, meaning that for a given
Expand Down
6 changes: 5 additions & 1 deletion tools/mkcomposefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ static void usage(const char *argv0)
" --from-file The source is a dump file, not a directory\n"
" --min-version=N Use this minimal format version (default=%d)\n"
" --max-version=N Use this maxium format version (default=%d)\n"
" --threads=N Use this to calculate digest and copy files in threads (default=%d)\n",
" --threads=N Use this to calculate digest and copy files in threads (default=%d)\n",
bin, LCFS_DEFAULT_VERSION_MIN, LCFS_DEFAULT_VERSION_MAX, 1);
}

Expand Down Expand Up @@ -1352,6 +1352,10 @@ int main(int argc, char **argv)
fprintf(stderr, "Invalid threads count %s\n", optarg);
exit(EXIT_FAILURE);
}
if (threads <= 0) {
fprintf(stderr, "Invalid threads count %d\n", threads);
exit(EXIT_FAILURE);
}
break;
case ':':
fprintf(stderr, "option needs a value\n");
Expand Down

0 comments on commit d833f84

Please sign in to comment.