~mil/sxmo-devel

sxmo-utils: Some improvements for the relock problem: Unable to open rtc device. But issue it not solved yet. #170 v1 APPLIED

Maarten van Gompel: 1
 Some improvements for the relock problem: Unable to open rtc device. But issue it not solved yet. #170

 1 files changed, 7 insertions(+), 2 deletions(-)
#432136 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~mil/sxmo-devel/patches/20381/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH sxmo-utils] Some improvements for the relock problem: Unable to open rtc device. But issue it not solved yet. #170 Export this patch

See https://todo.sr.ht/~mil/sxmo-tickets/170 . If anybody has any ideas
how to solve this properly then that would be most welcome.

---
 programs/sxmo_screenlock.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/programs/sxmo_screenlock.c b/programs/sxmo_screenlock.c
index 0535a01..5153891 100644
--- a/programs/sxmo_screenlock.c
+++ b/programs/sxmo_screenlock.c
@@ -195,7 +195,10 @@ sigterm()
{
	state = StateDead;
	syncstate();
	if (wakeinterval) close(rtc_fd);
	if (wakeinterval) {
		ioctl(rtc_fd, RTC_AIE_OFF, 0);
		close(rtc_fd);
	}
	fprintf(stderr, "Screenlock terminating on signal\n");
	exit(0);
}
@@ -474,6 +477,7 @@ void usage() {
void init_rtc() {
	rtc_fd = open(RTC_DEVICE, O_RDONLY);
	if (rtc_fd < 0) {
		fprintf(stderr, "Error opening rtc device: %d\n", rtc_fd);
		die("Unable to open rtc device");
		exit(EXIT_FAILURE);
	}
@@ -522,6 +526,8 @@ main(int argc, char **argv) {
	if (!(dpy = XOpenDisplay(NULL)))
		die("Cannot open display");

	getoldbrightness();

	if (wakeinterval) init_rtc();

	fprintf(stderr, "Screenlock starting\n");
@@ -529,7 +535,6 @@ main(int argc, char **argv) {
	XkbSetDetectableAutoRepeat(dpy, True, NULL);
	screen = XDefaultScreen(dpy);
	XSync(dpy, 0);
	getoldbrightness();
	syncstate();
	lockscreen(dpy, screen, target == StateNoInputNoScreen || target == StateSuspend);
	if ((target == StateNoInputNoScreen) || (target == StateSuspend)) {
--
2.30.1
builds.sr.ht
sxmo-utils/patches/.build.yml: SUCCESS in 18s

[Some improvements for the relock problem: Unable to open rtc device. But issue it not solved yet. #170][0] from [Maarten van Gompel][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/20381
[1]: mailto:proycon@anaproy.nl

✓ #432136 SUCCESS sxmo-utils/patches/.build.yml https://builds.sr.ht/~mil/job/432136