X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=fade.c;h=8fb02d402f5881542409b9e22583fc4aa191b146;hb=d3f9f845e13f5b280c9ea4078a1d7db649dbba3c;hp=6b87680131fa99608b5e258533c3a7fe8545391f;hpb=93ea9f34dcb35755568e6c94f9b9445fd4d1984a;p=paraslash.git diff --git a/fade.c b/fade.c index 6b876801..8fb02d40 100644 --- a/fade.c +++ b/fade.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2008 Andre Noll + * Copyright (C) 1998-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -13,14 +13,14 @@ #include "para.h" #include "fd.h" -#include +#include #include #include /* EXIT_SUCCESS */ #include #include #include #include -#include +#include #include "string.h" #include "error.h" @@ -28,7 +28,7 @@ INIT_FADE_ERRLISTS; struct fade_args_info conf; -void para_log(__a_unused int ll, const char *fmt,...) +__printf_2_3 void para_log(__a_unused int ll, const char *fmt, ...) { va_list argp; time_t t1; @@ -217,7 +217,7 @@ static int sweet_dreams(void) tm->tm_sec = 0; } else { t1 += 9 * 60 * 60; /* nine hours from now */ - PARA_INFO_LOG("default wake time: %lu\n", t1); + PARA_INFO_LOG("default wake time: %lu\n", (long unsigned)t1); tm = localtime(&t1); } wake_time_epoch = mktime(tm); @@ -238,7 +238,10 @@ static int sweet_dreams(void) if (ret < 0) return ret; } - change_afs_mode_and_play(sleep_mode); + if (conf.sleep_mode_given) + change_afs_mode_and_play(sleep_mode); + else + client_cmd("stop"); if (!wf) return 1; for (;;) {