From patchwork Fri Aug 22 11:57:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dietmar Maurer X-Patchwork-Id: 382181 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5692E14010C for ; Fri, 22 Aug 2014 21:58:33 +1000 (EST) Received: from localhost ([::1]:36504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKnUF-0002HT-If for incoming@patchwork.ozlabs.org; Fri, 22 Aug 2014 07:58:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKnTp-0001d8-7Y for qemu-devel@nongnu.org; Fri, 22 Aug 2014 07:58:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKnTk-0006wE-E4 for qemu-devel@nongnu.org; Fri, 22 Aug 2014 07:58:05 -0400 Received: from proxmox.maurer-it.com ([94.136.31.133]:36672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKnTk-0006p7-7y for qemu-devel@nongnu.org; Fri, 22 Aug 2014 07:58:00 -0400 Received: from proxmox.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox.maurer-it.com (Proxmox) with ESMTP id 4345E3A16002 for ; Fri, 22 Aug 2014 13:57:20 +0200 (CEST) From: Dietmar Maurer To: "qemu-devel@nongnu.org" Thread-Topic: glusterfs: do not log to stdout if daemonized Thread-Index: Ac+9/7SfawqVIYZDSAW7fAKCm1tvow== Date: Fri, 22 Aug 2014 11:57:18 +0000 Message-ID: <24E144B8C0207547AD09C467A8259F755D0ACF37@lisa.maurer-it.com> Accept-Language: en-US, de-AT Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 94.136.31.133 Subject: [Qemu-devel] glusterfs: do not log to stdout if daemonized X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Else stdout is not closed correctly. Signed-off-by: Dietmar Maurer Index: new/block/gluster.c =================================================================== --- new.orig/block/gluster.c 2014-08-22 13:21:39.000000000 +0200 +++ new/block/gluster.c 2014-08-22 13:25:18.000000000 +0200 @@ -196,9 +196,11 @@ * TODO: Use GF_LOG_ERROR instead of hard code value of 4 here when * GlusterFS makes GF_LOG_* macros available to libgfapi users. */ - ret = glfs_set_logging(glfs, "-", 4); - if (ret < 0) { - goto out; + if (!is_daemonized()) { + ret = glfs_set_logging(glfs, "-", 4); + if (ret < 0) { + goto out; + } } ret = glfs_init(glfs);