--logfile with relative paths behaves differently with and without --daemon
- Dominant language
- C
- Stars
- 8.8k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Copied from #1225:
> I ran into this when trying to figure out why the default location for the logfile changed when you don't use absolute path. Since the introduction of #871 when using --logfile some_file, the file is created in root directory as /some_file. Before this PR, the file was created in the directory where you run the iperf3 command. I was wondering if it would make sense to actually create the logfile before running the daemon() and thus before changing directory to '/' ? Maybe keep the iperf_open_logfile function but call it sooner rather than after the context has changed?
This is kind of a bug, albeit probably a minor one that can be worked around by using absolute pathnames with `--logfile` when there's a possibility of also using `--daemon`.
Contributor guide
Assessment
This issue has not been assessed yet.