On Wed, Jul 11, 2007 at 09:34:59PM +0200, Bernhard Walle wrote: > * Karel Zak <kzak@xxxxxxxxxx> [2007-07-05 23:59]: > > On Thu, Jul 05, 2007 at 04:44:25PM +0200, Bernhard Walle wrote: > > > Hi, > > > > > > wouldn't it make sense to include the wakeup tool from kernel commit > > > k87ac84f42a7a580d0dd72ae31d6a5eb4bfe04c6d [1] to util-linux? > > > > Send patch ;-) > > See below. I can write a manual page and adjust the program to read > utc/localtime from /etc/adjtime, Cool, go ahead. > but it makes no sense to do the > effort if you don't want such a program in utils-linux-ng. "send patch" != "don't want" :-) I don't see any problem with this new command. > + namei script whereis wakeup ^^^^^^ I think "rtcwake" is a better name -- it's more specific than "wakeup". > +#ifdef DEBUG > +#define VERSION "1.0 dev (" __DATE__ " " __TIME__ ")" > +#else > +#define VERSION "0.9" > +#endif #define VERSION "rtcwake from " PACKAGE_STRING > + FILE *f = fopen("/sys/power/state", "w"); > + > + if (!f) { > + perror("/sys/power/state"); #define POWER_STATE_PATH "/sys/power/state" > + while ((t = getopt(argc, argv, "d:lm:s:t:uVv")) != EOF) { or optionally getopt_long() > + default: > +usage: > + printf("usage: %s [options]" > + "\n\t" > + "-d rtc0|rtc1|...\t(select rtc)" > + "\n\t" > + "-l\t\t\t(RTC uses local timezone)" > + "\n\t" > + "-m standby|mem|...\t(sleep mode)" > + "\n\t" > + "-s seconds\t\t(seconds to sleep)" > + "\n\t" > + "-t time_t\t\t(time to wake)" > + "\n\t" > + "-u\t\t\t(RTC uses UTC)" > + "\n\t" > + "-v\t\t\t(verbose messages)" > + "\n\t" > + "-V\t\t\t(show version)" > + "\n", > + progname); > + return 1; Ugly, usage() please. Karel -- Karel Zak <kzak@xxxxxxxxxx> - To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html