Unverified Commit 44990884 by Stéphane Graber Committed by GitHub

Merge pull request #3790 from brauner/2021-04-15.fixes

lxc_clone & configure fix
parents 95dfbd42 3698c491
......@@ -467,10 +467,15 @@ if test "x$enable_sanitizers" = "xyes"; then
CC_CHECK_FLAGS_APPEND([AM_CFLAGS],[CFLAGS],[ \
-fsanitize=address \
-fsanitize=undefined \
-fsanitize=memory \
-fno-optimize-sibling-calls \
-fno-omit-frame-pointer])
AC_SUBST(AM_CFLAGS)
CC_CHECK_FLAGS_APPEND([AM_LDFLAGS],[LDFLAGS],[ \
-fsanitize=address])
AC_SUBST(AM_LDFLAGS)
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
......
......@@ -286,7 +286,8 @@ static ssize_t lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd)
}
return syserror_set(-ENOMEM, "Failed to receive response for command \"%s\"", cur_cmdstr);
case LXC_CMD_CONSOLE_LOG: /* data */
__data = zalloc(rsp->datalen + 1);
if (rsp->datalen > 0)
__data = zalloc(rsp->datalen + 1);
rsp->data = __data;
break;
default: /* catch any additional command */
......
......@@ -4,6 +4,9 @@
#define __LXC_ERROR_UTILS_H
#include <stdbool.h>
#include "macro.h"
#define MAX_ERRNO 4095
#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
......
......@@ -146,14 +146,12 @@ int lxc_raw_pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
#define __LXC_STACK_SIZE (8 * 1024 * 1024)
pid_t lxc_clone(int (*fn)(void *), void *arg, int flags, int *pidfd)
{
__do_free void *stack = NULL;
pid_t ret;
void *stack;
stack = malloc(__LXC_STACK_SIZE);
if (!stack) {
SYSERROR("Failed to allocate clone stack");
return -ENOMEM;
}
if (!stack)
return syserror_set(-ENOMEM, "Failed to allocate clone stack");
#ifdef __ia64__
ret = __clone2(fn, stack, __LXC_STACK_SIZE, flags | SIGCHLD, arg, pidfd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment