mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
Fix build when HAVE_LIBCAPNG is not defined.
The function daemon_become_new_user_linux was conditionally defined but
then used in code unconditionally. If HAVE_LIBCAPNG is not defined, the
function would never be called, but it still must exist.
Adjust the #if guard around the function to be around the body of the
function instead of outside of its definition to ensure the function is
always defined, even if empty.
This issue was introduced in e91b927d89
.
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
committed by
Ben Pfaff
parent
bf66c06797
commit
6e6271d2f5
@@ -804,10 +804,10 @@ daemon_become_new_user_unix(void)
|
||||
|
||||
/* Linux specific implementation of daemon_become_new_user()
|
||||
* using libcap-ng. */
|
||||
#if defined __linux__ && HAVE_LIBCAPNG
|
||||
static void
|
||||
daemon_become_new_user_linux(bool access_datapath)
|
||||
daemon_become_new_user_linux(bool access_datapath OVS_UNUSED)
|
||||
{
|
||||
#if defined __linux__ && HAVE_LIBCAPNG
|
||||
int ret;
|
||||
|
||||
ret = capng_get_caps_process();
|
||||
@@ -847,8 +847,8 @@ daemon_become_new_user_linux(bool access_datapath)
|
||||
VLOG_FATAL("%s: libcap-ng fail to switch to user and group "
|
||||
"%d:%d, aborting", pidfile, uid, gid);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
daemon_become_new_user__(bool access_datapath)
|
||||
|
Reference in New Issue
Block a user