Page MenuHomeFreeBSD

powerd: use nlsysevent if possible
ClosedPublic

Authored by bapt on Oct 7 2024, 8:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 25, 3:41 PM
Unknown Object (File)
Thu, Jan 23, 12:12 AM
Unknown Object (File)
Tue, Jan 21, 11:47 PM
Unknown Object (File)
Tue, Jan 14, 12:14 PM
Unknown Object (File)
Mon, Jan 13, 6:07 PM
Unknown Object (File)
Fri, Jan 10, 9:17 PM
Unknown Object (File)
Dec 3 2024, 7:35 AM
Unknown Object (File)
Dec 3 2024, 3:23 AM
Subscribers

Details

Reviewers
cperciva
imp
des
Summary

instead of depending on devd and its socket, try to use nlsysevent
instead. This makes powerd independant from devd.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59801
Build 56686: arc lint + arc unit

Event Timeline

bapt requested review of this revision.Oct 7 2024, 8:53 AM
bapt created this revision.
des accepted this revision.EditedOct 7 2024, 1:20 PM
des added a subscriber: des.

lgtm with only cosmetic issues.

BTW, I noticed that /etc/rc.d/powerd only indirectly depends on /etc/rc.d/devd (in that powerd requires DAEMON which requires NETWORKING which requires defaultroute which requires devd). Normally I would have said that this needs to be addressed, but this patch makes it unnecessary...

usr.sbin/powerd/powerd.c
31

These should be sorted, unless there is a dependency between them.

99

Is this just phab being weird or is there a tabs vs spaces issue here? (see also acline_init(), handle_sigs(), parse_mode()).

137

You're missing <stdbool.h>, it's probably being pulled in by something else but it would be better to include it explicitly.

340

double blank line

480

I would prefer unsigned int here.

485

This cast should not be needed unless the compiler is being weird.

This revision is now accepted and ready to land.Oct 7 2024, 1:20 PM
bapt marked 6 inline comments as done.

Address @des comments

This revision now requires review to proceed.Oct 7 2024, 1:30 PM
usr.sbin/powerd/powerd.c
99

yes phab only

about the rc script, powerd even before this patches can be started before devd, it has a retry mechanism to be able to connect to it once devd is up.

This revision is now accepted and ready to land.Oct 7 2024, 5:25 PM