Skip to content

drivers/upsdrvctl.c: send_all_drivers(): restart the list for each sdorder - #3835

Open
jayhemnani9910 wants to merge 1 commit into
networkupstools:masterfrom
jayhemnani9910:fix/upsdrvctl-shutdown-sdorder
Open

jayhemnani9910 wants to merge 1 commit into
networkupstools:masterfrom
jayhemnani9910:fix/upsdrvctl-shutdown-sdorder

Conversation

@jayhemnani9910

Copy link
Copy Markdown

Closes #3793

upsdrvctl shutdown with no device name only shut down devices with the first sdorder. The list pointer was set once before the sdorder loop, reached the end on the first pass, and later passes had nothing to walk. On a multi-UPS setup the later units never got the shutdown command.

The pointer now restarts for each sdorder. With three devices at sdorder 0, 1 and 2, upsdrvctl -t -D -D shutdown printed one exec: line before and prints all three in order now.

Tested with upsdrvctl -t, no real UPS. I built only common and drivers/upsdrvctl, so the full test suite didn't run. This code has no unit test.

Assisted by Claude Code.

…order

The list pointer was never reset, so only devices with the first sdorder
were shut down. Closes: networkupstools#3793

Signed-off-by: Jay Hemnani <193022578+jayhemnani9910@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Preparing a ZIP file with standard source tarball and another tarball with pre-built docs for commit 9176bab ...

@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: upsdrvctl shutdown skips UPSes with sdorder > 0

2 participants