summaryrefslogtreecommitdiffstats
path: root/sys-utils/rtcwake.c
Commit message (Collapse)AuthorAgeFilesLines
...
* rtcwake: tiny coding style changeKarel Zak2012-04-021-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: only invoke RTC_AIE_ON/OFF ioctls in pairsPaul Fox2012-04-021-1/+4
| | | | | | | | many rtc drivers don't implement the RTC_AIE_ON/OFF ioctls at all -- so if we never tried to enable the alarm interrupt, don't try to disable it later. Signed-off-by: Paul Fox <pgf@laptop.org>
* rtcwake: align with howto-usage-function.txtSami Kerola2011-10-301-7/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* rtcwake: fix crash (invalid free)Petr Uzel2011-10-171-1/+0Star
| | | | | | | | | | | | | | ~ $ rtcwake -d X -s 10 *** glibc detected *** rtcwake: munmap_chunk(): invalid pointer: 0x00007fff839253c3 *** ======= Backtrace: ========= /lib64/libc.so.6(+0x733b6)[0x7f582677a3b6] rtcwake[0x4022d5] /lib64/libc.so.6(__libc_start_main+0xfd)[0x7f5826725bfd] rtcwake[0x4016b9] ======= Memory map: ======== <SNIP> Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
* rtcwake: cleanup usage()Karel Zak2011-08-161-15/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: do not duplicate argument stringsDavidlohr Bueso2011-03-081-2/+2
| | | | | | | This is not necessary and prevents memory leaks. Reported-by: Marek Otahal <markotahal@gmail.com> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* rtcwake: test for available suspend modesLawrence Rust2011-02-281-0/+23
| | | | Signed-off-by: Lawrence Rust <lawrence@softsystem.co.uk>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-141-1/+1
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* rtcwake: use err.h routinesKarel Zak2010-11-261-71/+57Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: add 'show' mode for rtc alarmMarek Otahal2010-11-261-20/+90
| | | | | | | | | | The 'show' mode prints information on current alarm setting. [kzak@redhat.com: - code clean up - don't setup alarm on 'disable' mode] Signed-off-by: Marek Otahal <markotahal@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: make use xalloc wrappersDavidlohr Bueso2010-11-011-5/+2Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* rtcwake : add disable action for rtc alarmMarek Otahal2010-04-231-1/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: add --dry-run optionKarel Zak2010-04-081-17/+31
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: does miss the "off" optionKarel Zak2010-04-081-5/+19
| | | | | | Reported-by: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de> Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=580296 Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: ignore the tm_isdst field returned from the RTCPaul Fox2009-09-071-1/+1
| | | | Signed-off-by: Paul Fox <pgf@laptop.org>
* rtcwake: add S5 supportKarel Zak2009-09-071-1/+23
| | | | | | | | | | | | | | | | | | | | | Based on patch from Piergiorgio Sartor <piergiorgio.sartor@nexgo.de> at https://bugzilla.redhat.com/show_bug.cgi?id=449115 Piergiorgio's note about S5: > According to the ACPI specifications, chapter 4.7.2.4 "Real Time > Clock Alarm", the wakeup from RTC, when supported, should work from > *sleep* state S1-S3 and, optionally, from S4. > > Note 3 (same chapter) says that S5 is *not* a sleep state and should > not be supported. Actually it also says that: "The OS will disable > the RTC_EN bit prior to entering the G2/S5 or G3 states regardless." > > Nevertheless, on all PC supporting the RTC wakeup I tested, all were > able to wake from S5. Signed-off-by: Karel Zak <kzak@redhat.com>
* replace usleep() for systems that don't have themDaniel Mierswa2009-08-211-0/+1
| | | | | | | | | This function is marked obsolete in POSIX.1-2001 and removed in POSIX.1-2008. Conditionally replaced with nanosleep(). Signed-off-by: Daniel Mierswa <impulze@impulze.org>
* rtcwake: support not suspendingMarco d'Itri2009-01-261-4/+8
| | | | | | | | | | People usually want to use pm-utils to suspend the system instead of the raw kernel interface, so I added an option to just exit after configuring the wakeup time. Actually I think that all the suspend code should be removed from rtcwake, since it does not really belong there. Signed-off-by: Marco d'Itri <md@linux.it>
* rtcwake: cleanup return codesKarel Zak2008-08-061-14/+14
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: prefer RTC_WKALM_SET over RTC_ALM_SETGabriel Burt2008-08-061-18/+17Star
| | | | | | | | rtcwake: Prefer RTC_WKALM_SET over RTC_ALM_SET, fixing bug with not waking up with new RTCs. Also, return error if unable to set the alarm. Signed-off-by: Gabriel Burt <gburt@novell.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: fix the default mode to "standby"Paulius Zaleckas2008-06-091-1/+1
| | | | | | | | Writing "suspend" to /sys/power/state does nothing. Even "man rtcwake" says that default should be "standby" :) Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: fix typo SATE -> STATEMike Frysinger2008-02-151-3/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* rtcwake: include libgen.h for basename prototypeMike Frysinger2008-02-151-0/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* rtcwake: fix UTC time usageDavid Brownell2008-02-081-1/+11
| | | | | | | | | | | | Timezone handling is broken in this version since it's always passing UTC time into the kernel, even on systems where the RTC uses the local timezone. I think that bug must come from bugs in how the system used to to originally develop this code handled the RTC timezone. Both RTCs should have been kept in UTC ... but only one of them was. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* rtcwake: misc cleanupsDavid Brownell2007-12-031-20/+28
| | | | | | | | | | | | | | | | | | | | Cleanups for rtcwake: - Minor doc updates: highlight the framebuffer problem, give correct history of this code - Improve debug output - Fix some linelength bugs Note that this code predated the sysfs "wakealarm" mechanism, and works around several now-fixed bugs in the kernel RTC framework. Nowadays it would make sense to make this program use only the sysfs interface to the RTC, using "since_epoch" instead of RTC_RD_TIME and "wakealarm" instead of the four other ioctls. That could simplify the mess involved in timezone handling. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: fix typoKarel Zak2007-10-111-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rtcwake: fix verbose messageKarel Zak2007-10-041-2/+2
| | | | | | Just make NLS transtalors more happy. (rh#292081) Signed-off-by: Karel Zak <kzak@redhat.com>
* misc-util: new rtcwake commandBernhard Walle2007-07-161-0/+465
Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>