+ /* calculate wake time */
+ time(&t1);
+ if (conf.wake_hour_given) {
+ int hour = conf.wake_hour_arg;
+ tm = localtime(&t1);
+ if (tm->tm_hour > hour || (tm->tm_hour == hour && tm->tm_min> min)) {
+ t1 += 86400; /* wake time is tomorrow */
+ tm = localtime(&t1);
+ }
+ tm->tm_hour = hour;
+ tm->tm_min = min;
+ tm->tm_sec = 0;
+ } else {
+ t1 += 8 * 60 * 60;
+ PARA_INFO_LOG("default wake time: %lu\n", t1);
+ tm = localtime(&t1);
+ }
+ wake_time_epoch = mktime(tm);
+ PARA_INFO_LOG("waketime: %s", asctime(tm));