Fix: FreeBSD: Pass flags arguments to rfork wrapper
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 12 Aug 2023 17:19:52 +0000 (13:19 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 12 Aug 2023 17:19:52 +0000 (13:19 -0400)
Backported from:

commit e2a195a6849 ("Fix warnings on FreeBSD")

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I12aa474cd057645337f03de22d7c6010266398f3

liblttng-ust-fork/ustfork.c

index 983ed04f83e11316690430e494ffe4939a44bd9b..fc83d05c3d3797cd7d0811277525bc71b8f3ba1c 100644 (file)
@@ -24,6 +24,7 @@
 #include <signal.h>
 #include <sched.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <errno.h>
 
 #include <lttng/ust.h>
@@ -414,7 +415,7 @@ int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
 
 pid_t rfork(int flags)
 {
-       static pid_t (*plibc_func)(void) = NULL;
+       static pid_t (*plibc_func)(int flags) = NULL;
        sigset_t sigset;
        pid_t retval;
        int saved_errno;
@@ -430,7 +431,7 @@ pid_t rfork(int flags)
 
        ust_before_fork(&sigset);
        /* Do the real rfork */
-       retval = plibc_func();
+       retval = plibc_func(flags);
        saved_errno = errno;
        if (retval == 0) {
                /* child */
This page took 0.032403 seconds and 4 git commands to generate.