Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH] spp_primary: change log file open mode
Date: Fri,  1 Feb 2019 11:29:53 +0900	[thread overview]
Message-ID: <1548988193-28387-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

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 <ogawa.yasufumi@lab.ntt.co.jp>
---
 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

                 reply	other threads:[~2019-02-01  2:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1548988193-28387-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).