From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bcmv-tmail01.ecl.ntt.co.jp (bcmv-tmail01.ecl.ntt.co.jp [124.146.185.148]) by dpdk.org (Postfix) with ESMTP id DFBE71B494 for ; Fri, 1 Feb 2019 03:32:03 +0100 (CET) Received: from bcmv-ns01.ecl.ntt.co.jp (bcmv-ns01.ecl.ntt.co.jp [129.60.83.123]) by bcmv-tmail01.ecl.ntt.co.jp (8.14.4/8.14.4) with ESMTP id x112W2x8019811; Fri, 1 Feb 2019 11:32:02 +0900 Received: from bcmv-ns01.ecl.ntt.co.jp (localhost [127.0.0.1]) by bcmv-ns01.ecl.ntt.co.jp (Postfix) with ESMTP id 3C440138; Fri, 1 Feb 2019 11:32:02 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by bcmv-ns01.ecl.ntt.co.jp (Postfix) with ESMTP id 27746125; Fri, 1 Feb 2019 11:32:02 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp Date: Fri, 1 Feb 2019 11:29:53 +0900 Message-Id: <1548988193-28387-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable Subject: [spp] [PATCH] spp_primary: change log file open mode X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 02:32:04 -0000 From: Yasufumi Ogawa This update is to change to open file in create and append mode to accept next logs after the process is terminated at once. Signed-off-by: Yasufumi Ogawa --- src/primary/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/primary/main.c b/src/primary/main.c index 8d12bf6..fc9ca9b 100644 --- a/src/primary/main.c +++ b/src/primary/main.c @@ -284,8 +284,10 @@ launch_sec_proc(char *sec_name, int sec_id, char **sec_args) RTE_LOG(ERR, PRIMARY, "Failed to open secondary proc.\n"); else if (pid == 0) { - /* Open log file with permission `0664` */ - fd = open(path_spp_log, O_RDWR | O_CREAT, 0664); + /* Open log file with mode equals to 'a+' */ + fd = open(path_spp_log, + O_RDWR | O_CREAT | O_APPEND, + 0666); /* change to output of stdout and stderr to logfile */ dup2(fd, 1); -- 2.7.4