* [spp] [PATCH] spp_primary: change log file open mode
@ 2019-02-01 2:29 ogawa.yasufumi
0 siblings, 0 replies; only message in thread
From: ogawa.yasufumi @ 2019-02-01 2:29 UTC (permalink / raw)
To: ferruh.yigit, spp, ogawa.yasufumi
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-02-01 2:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-01 2:29 [spp] [PATCH] spp_primary: change log file open mode ogawa.yasufumi
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).