[sheepdog] [PATCH v1] add foreground option
Alexander Guy
alexander at andern.org
Tue Mar 17 20:05:44 CET 2015
On Tue, Mar 17, 2015 at 07:15:03PM +0300, Vasiliy Tolstov wrote:
> Signed-off-by: Vasiliy Tolstov <v.tolstov at selfip.ru>
Hey Vasiliy,
It doesn't look like you tested this at all.
> ---
> sheep/sheep.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/sheep/sheep.c b/sheep/sheep.c
> index fc53ec9..58097ef 100644
> --- a/sheep/sheep.c
> +++ b/sheep/sheep.c
> @@ -905,7 +910,10 @@ int main(int argc, char **argv)
>
> srandom(port);
>
> - if (lock_and_daemon(log_dst_type != LOG_DST_STDOUT, dir)) {
> + if (!foreground && log_dst_type == LOG_DST_STDOUT)
> + foreground = false;
This is backwards, which breaks the foreground-on-stdout-logging
behavior.
> +
> + if (lock_and_daemon(foreground, dir)) {
This is backwards, which breaks the default daemonizing behavior.
Alexander
More information about the sheepdog
mailing list