Skip to content

Commit 46f6050

Browse files
committed
Don't chdir when becoming a daemon.
This fixes some non-intuitive behavior when using the iperf3 authentication feature, where iperf3 was able to use a relative path to locate the credentials file when being run "normally" but not if it was being run as a --daemon (the workaround was to use only absolute pathname arguments).
1 parent cd18344 commit 46f6050

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ run(struct iperf_test *test)
154154
case 's':
155155
if (test->daemon) {
156156
int rc;
157-
rc = daemon(0, 0);
157+
rc = daemon(1, 0);
158158
if (rc < 0) {
159159
i_errno = IEDAEMON;
160160
iperf_errexit(test, "error - %s", iperf_strerror(i_errno));

0 commit comments

Comments
 (0)