git: b64f1988e365 - main - sysutils/battmond: Fix battmond dies after first suspend
Alexandre C. Guimarães
rigoletto at FreeBSD.org
Sun Apr 11 13:14:02 UTC 2021
The branch main has been updated by rigoletto:
URL: https://cgit.FreeBSD.org/ports/commit/?id=b64f1988e365b12baed8efb0e99a07299f8741e2
commit b64f1988e365b12baed8efb0e99a07299f8741e2
Author: Alexandre C. Guimarães <rigoletto at FreeBSD.org>
AuthorDate: 2021-04-11 13:08:15 +0000
Commit: Alexandre C. Guimarães <rigoletto at FreeBSD.org>
CommitDate: 2021-04-11 13:08:15 +0000
sysutils/battmond: Fix battmond dies after first suspend
- Fix won't acting if battery level suddenly drops to zero
PR: 251618 251619
Submitted by: dirtystickyfloor at web.de
Approved by: ntarmos at gmail.com (maintainer timeout, 127 days)
---
sysutils/battmond/files/patch-battmond.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/sysutils/battmond/files/patch-battmond.c b/sysutils/battmond/files/patch-battmond.c
new file mode 100644
index 000000000000..1da5a1b6eb42
--- /dev/null
+++ b/sysutils/battmond/files/patch-battmond.c
@@ -0,0 +1,18 @@
+--- battmond.c.orig 2021-04-11 13:03:15 UTC
++++ battmond.c
+@@ -189,13 +189,12 @@ int main(int argc, char ** argv)
+ #ifdef DEBUG
+ fprintf(stderr, "Total battery capacity: %d%%\n", total_cap);
+ #endif
+- if (num_discharging && !num_charging && total_cap > 0) {
++ if (num_discharging && !num_charging && total_cap >= 0) {
+ if (total_cap <= halt) {
+ if (dosuspend) { // Suspend
+ syslog(LOG_EMERG, BATT_SUSP);
+ close(acpifd);
+- execl("/usr/sbin/acpiconf", "acpiconf", "-s3", NULL);
+- oops("execl");
++ system("/usr/sbin/acpiconf -s3");
+ } else { // Halt
+ syslog(LOG_EMERG, BATT_HALT);
+ close(acpifd);
More information about the dev-commits-ports-all
mailing list