summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/opiealarm/Makefile2
-rw-r--r--core/opiealarm/opiealarm.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/opiealarm/Makefile b/core/opiealarm/Makefile
index e988abf..f20d451 100644
--- a/core/opiealarm/Makefile
+++ b/core/opiealarm/Makefile
@@ -12,9 +12,9 @@ LDFLAGS:=
12all: $(DESTDIR)/opiealarm $(DESTDIR)/opieatd 12all: $(DESTDIR)/opiealarm $(DESTDIR)/opieatd
13 13
14$(DESTDIR)/opiealarm: opiealarm.c 14$(DESTDIR)/opiealarm: opiealarm.c
15 $(CC) $(CFLAGS) opiealarm.c -o $(DESTDIR)/opiealarm $(LDFLAGS) 15 $(CC) $(CFLAGS) opiealarm.c -o $(DESTDIR)/opiealarm $(LDFLAGS)
16 $(STRIP) -s $(DESTDIR)/opiealarm 16 $(STRIP) --strip-all $(DESTDIR)/opiealarm
17 chmod u+s $(DESTDIR)/opiealarm 17 chmod u+s $(DESTDIR)/opiealarm
18 chown root $(DESTDIR)/opiealarm 2>/dev/null || echo -e "\nopiealarm must be owned by root to work correctly.\n" 18 chown root $(DESTDIR)/opiealarm 2>/dev/null || echo -e "\nopiealarm must be owned by root to work correctly.\n"
19 19
20$(DESTDIR)/opieatd: opieatd 20$(DESTDIR)/opieatd: opieatd
diff --git a/core/opiealarm/opiealarm.c b/core/opiealarm/opiealarm.c
index 71367b3..ce0103e 100644
--- a/core/opiealarm/opiealarm.c
+++ b/core/opiealarm/opiealarm.c
@@ -242,9 +242,9 @@ int suspend ( int fix_rtc )
242 error_msg_and_die ( 1, "/dev/misc/rtc" ); 242 error_msg_and_die ( 1, "/dev/misc/rtc" );
243 243
244 // get RTC time 244 // get RTC time
245 memset ( &rtc, 0, sizeof ( struct tm )); 245 memset ( &rtc, 0, sizeof ( struct tm ));
246 if ( ioctl ( fd, RTC_ALM_SET, &rtc ) < 0 ) 246 if ( ioctl ( fd, RTC_RD_TIME, &rtc ) < 0 )
247 error_msg_and_die ( 1, "ioctl RTC_RD_TIME" ); 247 error_msg_and_die ( 1, "ioctl RTC_RD_TIME" );
248 rtct = mktime ( &rtc ); 248 rtct = mktime ( &rtc );
249 249
250 fprintf ( log, "System time: %02d.%02d.%04d %02d:%02d:%02d DST: %d (TZ: %s, offset: %d)\n", sys. tm_mday, sys. tm_mon + 1, sys. tm_year + 1900, sys. tm_hour, sys. tm_min, sys. tm_sec, sys. tm_isdst, sys. tm_zone, sys. tm_gmtoff ); 250 fprintf ( log, "System time: %02d.%02d.%04d %02d:%02d:%02d DST: %d (TZ: %s, offset: %d)\n", sys. tm_mday, sys. tm_mon + 1, sys. tm_year + 1900, sys. tm_hour, sys. tm_min, sys. tm_sec, sys. tm_isdst, sys. tm_zone, sys. tm_gmtoff );