rmtfs: Fix command line argument parsing for '-o' optarg

Commit 2ee01bf ("storage: Try opening the slot-suffixed partition")
introduced a bug where option '-o' is incorrectly specified as having no
argument. Therefore, passing -o with a path incorrectly sets that path
to the default '/boot' one as optarg evaluates to NULL. Fix this by
telling getopt that we expect an argument.

Fixes: 2ee01bf ("storage: Try opening the slot-suffixed partition")
Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
This commit is contained in:
Maximilian Luz
2026-01-03 22:58:44 +01:00
committed by Bjorn Andersson
parent f9847a777c
commit 14cb1ee69f

View File

@@ -505,7 +505,7 @@ int main(int argc, char **argv)
int option; int option;
const char *storage_root = NULL; const char *storage_root = NULL;
while ((option = getopt(argc, argv, "oS:Prsv")) != -1) { while ((option = getopt(argc, argv, "o:S:Prsv")) != -1) {
switch (option) { switch (option) {
/* /*
* -o sets the directory where EFS images are stored, * -o sets the directory where EFS images are stored,