get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/129078/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 129078,
    "url": "http://patchwork.dpdk.org/api/patches/129078/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230628175827.471909-2-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230628175827.471909-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230628175827.471909-2-stephen@networkplumber.org",
    "date": "2023-06-28T17:58:22",
    "name": "[v5,1/6] eal: unify logging code for FreeBsd and Linux",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3a57ff641effbb855ef2a195a7652b0ebcc4a57c",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230628175827.471909-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 28695,
            "url": "http://patchwork.dpdk.org/api/series/28695/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28695",
            "date": "2023-06-28T17:58:21",
            "name": "Logging related patches",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/28695/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129078/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/129078/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8395242D82;\n\tWed, 28 Jun 2023 19:58:38 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1EDFA41138;\n\tWed, 28 Jun 2023 19:58:34 +0200 (CEST)",
            "from mail-pl1-f172.google.com (mail-pl1-f172.google.com\n [209.85.214.172])\n by mails.dpdk.org (Postfix) with ESMTP id 6BA2240151\n for <dev@dpdk.org>; Wed, 28 Jun 2023 19:58:32 +0200 (CEST)",
            "by mail-pl1-f172.google.com with SMTP id\n d9443c01a7336-1b80bce2592so1273615ad.2\n for <dev@dpdk.org>; Wed, 28 Jun 2023 10:58:32 -0700 (PDT)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n g11-20020a170902868b00b001b80d399730sm5047875plo.242.2023.06.28.10.58.30\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 28 Jun 2023 10:58:30 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1687975111;\n x=1690567111;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=tvXiIXZpBRp3ib4jXS9jUY5f0cGBdfQa0cAlZSJQmr8=;\n b=IeP/TXtexKhL4zMr7qiobBmP+4+1Om4eP/tYUMGXuqHp6/SiGnjTprnJP/70cnylGA\n 7JZGE7tD+B0o2gSV61IuaPy8Blv8STqmEY5IAi1D8vbhoG3SeJuOxDyjsiOM3TWarpg/\n OTLwgWQA+XV4TX1UP03YeUXHCql9GhCs/R95HARpCyOYftyPRGt3xlnZXjGOKD2B0daE\n xD4fgr9VgdwqufGsF9HNTmBS7Mvk6Sg/KqGqCQnnFfeB375xYdjXfRliqpOy6rI6IOlI\n xBpAX7j3RNfjN7h7awRS8qQeS6B2PGdMBi5yVw4EFAKGrjiA8Gxi1f7CM4L2bmYXxc0y\n zxag==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1687975111; x=1690567111;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=tvXiIXZpBRp3ib4jXS9jUY5f0cGBdfQa0cAlZSJQmr8=;\n b=JsemMJNqPoVnP4a2Eorffnd1ajgr8HyZNSx8jS8x+6SdoiWSCMMl9KnB/IaRkYVWq8\n jxftszxjgJgKSaN09FCJg/H4crbCc4MvRK7Eig0k8rQAG1k1nbehZmrl2iUkn3tq9HBv\n 0cue6rMLP1TUpymR+U9pS79YI/u5OmbJOIkRG8v0VJeVWtx48/w7Ti/cJnf9U18CoScO\n 22J0qHT8Tk9WwO6JmO7xWz16h/cImYIgJ+W646h5TSLiI0NIfBSDEhY8FQDRqKKJ7dAD\n 51u4FAQNttwWG6UaeosfLZlH4LCuRr5e/HyPmeo1n+yiKAL+BKn0fPxwyPNfB+MIGewO\n 4Kcg==",
        "X-Gm-Message-State": "AC+VfDz5v6uGO//skTZ7c8uTnvk955I4xbA6km3KgNAkxp8CpUPInYa0\n 2zuLo+pMIxIz8D7xGvkqKg7rkxx3BFlrYXld3RhPBw==",
        "X-Google-Smtp-Source": "\n ACHHUZ78HoJqdmxXyB/GohOVlzx6KSe6aXLr04vdxvz5PIWoenSvsOGzY6+FoQ9R6cg5phxdoWL+mw==",
        "X-Received": "by 2002:a17:902:d305:b0:1b5:5bf2:b7d2 with SMTP id\n b5-20020a170902d30500b001b55bf2b7d2mr9406895plc.49.1687975111025;\n Wed, 28 Jun 2023 10:58:31 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Subject": "[PATCH v5 1/6] eal: unify logging code for FreeBsd and Linux",
        "Date": "Wed, 28 Jun 2023 10:58:22 -0700",
        "Message-Id": "<20230628175827.471909-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230628175827.471909-1-stephen@networkplumber.org>",
        "References": "<20200814173441.23086-1-stephen@networkplumber.org>\n <20230628175827.471909-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "FreeBSD logging code was not using syslog and did not have\nthe same options as Linux. Move the log writing code to common\nsource tree.\n\nAlso fix a number of argument parsing bugs:\n 1. If application is given a bogus option, the error message\n    would get printed twice. Once during scan for log level and\n    again during parsing of arguments.\n 2. A bad argument give to --log-level option was given the\n    code would keep going.\n 3. The syslog facility argument was parsed too late to\n    all log to be initialized before other errors.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n .../freebsd_gsg/freebsd_eal_parameters.rst    |  27 ++++\n lib/eal/common/eal_log.h                      |   5 +\n lib/eal/freebsd/eal.c                         |  55 ++------\n lib/eal/linux/eal.c                           |  48 +------\n lib/eal/linux/eal_log.c                       |  61 ---------\n lib/eal/linux/meson.build                     |   1 -\n lib/eal/unix/eal_log.c                        | 121 ++++++++++++++++++\n lib/eal/unix/meson.build                      |   1 +\n 8 files changed, 173 insertions(+), 146 deletions(-)\n delete mode 100644 lib/eal/linux/eal_log.c\n create mode 100644 lib/eal/unix/eal_log.c",
    "diff": "diff --git a/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst b/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst\nindex fba467a2ce92..9270d9fa3bfc 100644\n--- a/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst\n+++ b/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst\n@@ -18,3 +18,30 @@ FreeBSD-specific EAL parameters\n -------------------------------\n \n There are currently no FreeBSD-specific EAL command-line parameters available.\n+\n+Other options\n+~~~~~~~~~~~~~\n+\n+*   ``--syslog <syslog facility>``\n+\n+    Set syslog facility. Valid syslog facilities are::\n+\n+        auth\n+        cron\n+        daemon\n+        ftp\n+        kern\n+        lpr\n+        mail\n+        news\n+        syslog\n+        user\n+        uucp\n+        local0\n+        local1\n+        local2\n+        local3\n+        local4\n+        local5\n+        local6\n+        local7\ndiff --git a/lib/eal/common/eal_log.h b/lib/eal/common/eal_log.h\nindex c784fa604389..31dc489350f6 100644\n--- a/lib/eal/common/eal_log.h\n+++ b/lib/eal/common/eal_log.h\n@@ -13,6 +13,11 @@\n  */\n int eal_log_init(const char *id, int facility);\n \n+/*\n+ * Scan command line args for log settings.\n+ */\n+int eal_log_level_parse(int argc, char * const argv[]);\n+\n /*\n  * Determine where log data is written when no call to rte_openlog_stream.\n  */\ndiff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c\nindex 7008303e112a..bb9a2b1653d9 100644\n--- a/lib/eal/freebsd/eal.c\n+++ b/lib/eal/freebsd/eal.c\n@@ -52,6 +52,7 @@\n #include \"eal_hugepages.h\"\n #include \"eal_options.h\"\n #include \"eal_memcfg.h\"\n+#include \"eal_log.h\"\n #include \"eal_trace.h\"\n \n #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)\n@@ -363,48 +364,6 @@ eal_get_hugepage_mem_size(void)\n \treturn (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX;\n }\n \n-/* Parse the arguments for --log-level only */\n-static void\n-eal_log_level_parse(int argc, char **argv)\n-{\n-\tint opt;\n-\tchar **argvopt;\n-\tint option_index;\n-\tconst int old_optind = optind;\n-\tconst int old_optopt = optopt;\n-\tconst int old_optreset = optreset;\n-\tchar * const old_optarg = optarg;\n-\tstruct internal_config *internal_conf =\n-\t\teal_get_internal_configuration();\n-\n-\targvopt = argv;\n-\toptind = 1;\n-\toptreset = 1;\n-\n-\twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n-\t\t\t\t  eal_long_options, &option_index)) != EOF) {\n-\n-\t\tint ret;\n-\n-\t\t/* getopt is not happy, stop right now */\n-\t\tif (opt == '?')\n-\t\t\tbreak;\n-\n-\t\tret = (opt == OPT_LOG_LEVEL_NUM) ?\n-\t\t    eal_parse_common_option(opt, optarg, internal_conf) : 0;\n-\n-\t\t/* common parser is not happy */\n-\t\tif (ret < 0)\n-\t\t\tbreak;\n-\t}\n-\n-\t/* restore getopt lib */\n-\toptind = old_optind;\n-\toptopt = old_optopt;\n-\toptreset = old_optreset;\n-\toptarg = old_optarg;\n-}\n-\n /* Parse the argument given in the command line of the application */\n static int\n eal_parse_args(int argc, char **argv)\n@@ -610,7 +569,11 @@ rte_eal_init(int argc, char **argv)\n \teal_save_args(argc, argv);\n \n \t/* set log level as early as possible */\n-\teal_log_level_parse(argc, argv);\n+\tif (eal_log_level_parse(argc, argv) < 0) {\n+\t\trte_eal_init_alert(\"invalid log option.\");\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n \n \tif (rte_eal_cpu_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot detect lcores.\");\n@@ -759,6 +722,12 @@ rte_eal_init(int argc, char **argv)\n #endif\n \t}\n \n+\tif (eal_log_init(getprogname(), internal_conf->syslog_facility) < 0) {\n+\t\trte_eal_init_alert(\"Cannot init logging.\");\n+\t\trte_errno = ENOMEM;\n+\t\treturn -1;\n+\t}\n+\n \t/* in secondary processes, memory init may allocate additional fbarrays\n \t * not present in primary processes, so to avoid any potential issues,\n \t * initialize memzones first.\ndiff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c\nindex 145afafde234..d7f268fc8116 100644\n--- a/lib/eal/linux/eal.c\n+++ b/lib/eal/linux/eal.c\n@@ -546,45 +546,6 @@ eal_parse_vfio_vf_token(const char *vf_token)\n \treturn -1;\n }\n \n-/* Parse the arguments for --log-level only */\n-static void\n-eal_log_level_parse(int argc, char **argv)\n-{\n-\tint opt;\n-\tchar **argvopt;\n-\tint option_index;\n-\tconst int old_optind = optind;\n-\tconst int old_optopt = optopt;\n-\tchar * const old_optarg = optarg;\n-\tstruct internal_config *internal_conf =\n-\t\teal_get_internal_configuration();\n-\n-\targvopt = argv;\n-\toptind = 1;\n-\n-\twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n-\t\t\t\t  eal_long_options, &option_index)) != EOF) {\n-\n-\t\tint ret;\n-\n-\t\t/* getopt is not happy, stop right now */\n-\t\tif (opt == '?')\n-\t\t\tbreak;\n-\n-\t\tret = (opt == OPT_LOG_LEVEL_NUM) ?\n-\t\t\teal_parse_common_option(opt, optarg, internal_conf) : 0;\n-\n-\t\t/* common parser is not happy */\n-\t\tif (ret < 0)\n-\t\t\tbreak;\n-\t}\n-\n-\t/* restore getopt lib */\n-\toptind = old_optind;\n-\toptopt = old_optopt;\n-\toptarg = old_optarg;\n-}\n-\n static int\n eal_parse_huge_worker_stack(const char *arg)\n {\n@@ -649,7 +610,7 @@ eal_parse_args(int argc, char **argv)\n \t\t\tgoto out;\n \t\t}\n \n-\t\t/* eal_log_level_parse() already handled this option */\n+\t\t/* eal_log_level_parse() already handled these */\n \t\tif (opt == OPT_LOG_LEVEL_NUM)\n \t\t\tcontinue;\n \n@@ -993,7 +954,12 @@ rte_eal_init(int argc, char **argv)\n \teal_reset_internal_config(internal_conf);\n \n \t/* set log level as early as possible */\n-\teal_log_level_parse(argc, argv);\n+\tif (eal_log_level_parse(argc, argv) < 0) {\n+\t\trte_eal_init_alert(\"invalid log option.\");\n+\t\trte_errno = EINVAL;\n+\t\t__atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);\n+\t\treturn -1;\n+\t}\n \n \t/* clone argv to report out later in telemetry */\n \teal_save_args(argc, argv);\ndiff --git a/lib/eal/linux/eal_log.c b/lib/eal/linux/eal_log.c\ndeleted file mode 100644\nindex d44416fd6570..000000000000\n--- a/lib/eal/linux/eal_log.c\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2014 Intel Corporation\n- */\n-\n-#include <stdio.h>\n-#include <sys/types.h>\n-#include <syslog.h>\n-\n-#include <rte_log.h>\n-\n-#include \"eal_log.h\"\n-\n-/*\n- * default log function\n- */\n-static ssize_t\n-console_log_write(__rte_unused void *c, const char *buf, size_t size)\n-{\n-\tssize_t ret;\n-\n-\t/* write on stderr */\n-\tret = fwrite(buf, 1, size, stderr);\n-\tfflush(stderr);\n-\n-\t/* Syslog error levels are from 0 to 7, so subtract 1 to convert */\n-\tsyslog(rte_log_cur_msg_loglevel() - 1, \"%.*s\", (int)size, buf);\n-\n-\treturn ret;\n-}\n-\n-static int\n-console_log_close(__rte_unused void *c)\n-{\n-\tcloselog();\n-\treturn 0;\n-}\n-\n-static cookie_io_functions_t console_log_func = {\n-\t.write = console_log_write,\n-\t.close = console_log_close,\n-};\n-\n-/*\n- * set the log to default function, called during eal init process,\n- * once memzones are available.\n- */\n-int\n-eal_log_init(const char *id, int facility)\n-{\n-\tFILE *log_stream;\n-\n-\tlog_stream = fopencookie(NULL, \"w+\", console_log_func);\n-\tif (log_stream == NULL)\n-\t\treturn -1;\n-\n-\topenlog(id, LOG_NDELAY | LOG_PID, facility);\n-\n-\teal_log_set_default(log_stream);\n-\n-\treturn 0;\n-}\ndiff --git a/lib/eal/linux/meson.build b/lib/eal/linux/meson.build\nindex 5af456db9edb..e99ebed25692 100644\n--- a/lib/eal/linux/meson.build\n+++ b/lib/eal/linux/meson.build\n@@ -11,7 +11,6 @@ sources += files(\n         'eal_hugepage_info.c',\n         'eal_interrupts.c',\n         'eal_lcore.c',\n-        'eal_log.c',\n         'eal_memalloc.c',\n         'eal_memory.c',\n         'eal_thread.c',\ndiff --git a/lib/eal/unix/eal_log.c b/lib/eal/unix/eal_log.c\nnew file mode 100644\nindex 000000000000..f8a5c853f2df\n--- /dev/null\n+++ b/lib/eal/unix/eal_log.c\n@@ -0,0 +1,121 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2014 Intel Corporation\n+ */\n+\n+#include <getopt.h>\n+#include <stdio.h>\n+#include <sys/types.h>\n+#include <syslog.h>\n+\n+#include <rte_log.h>\n+\n+#include \"eal_log.h\"\n+#include \"eal_internal_cfg.h\"\n+#include \"eal_options.h\"\n+#include \"eal_private.h\"\n+\n+/*\n+ * default log function\n+ */\n+static ssize_t\n+console_log_write(__rte_unused void *c, const char *buf, size_t size)\n+{\n+\tssize_t ret;\n+\n+\t/* write on stderr */\n+\tret = fwrite(buf, 1, size, stderr);\n+\tfflush(stderr);\n+\n+\t/* Syslog error levels are from 0 to 7, so subtract 1 to convert */\n+\tsyslog(rte_log_cur_msg_loglevel() - 1, \"%.*s\", (int)size, buf);\n+\n+#ifdef RTE_EXEC_ENV_LINUX\n+\t/* Handle glibc quirk: write function should return the number of bytes\n+\t * copied from buf, or 0 on error. (The function must not return a negative value.)\n+\t * FreeBSD expects that write function behaves like write(2).\n+\t */\n+\tif (ret < 0)\n+\t\tret = 0;\n+#endif\n+\n+\treturn ret;\n+}\n+\n+static int\n+console_log_close(__rte_unused void *c)\n+{\n+\tcloselog();\n+\treturn 0;\n+}\n+\n+static cookie_io_functions_t console_log_func = {\n+\t.write = console_log_write,\n+\t.close = console_log_close,\n+};\n+\n+\n+/*\n+ * Parse the arguments for --log-level and --syslog\n+ */\n+int\n+eal_log_level_parse(int argc, char *const argv[])\n+{\n+\tstruct internal_config *internal_conf = eal_get_internal_configuration();\n+\tint option_index, opt;\n+\tconst int old_optind = optind;\n+\tconst int old_optopt = optopt;\n+\tchar * const old_optarg = optarg;\n+#ifdef RTE_EXEC_ENV_FREEBSD\n+\tconst int old_optrset = optreset;\n+#endif\n+\n+\toptind = 1;\n+#ifdef RTE_EXEC_ENV_FREEBSD\n+\toptreset = 1;\n+#endif\n+\n+\twhile ((opt = getopt_long(argc, argv, eal_short_options,\n+\t\t\t\t  eal_long_options, &option_index)) != EOF) {\n+\n+\t\tswitch (opt) {\n+\t\tcase OPT_LOG_LEVEL_NUM:\n+\t\t\tif (eal_parse_common_option(opt, optarg, internal_conf) < 0)\n+\t\t\t\treturn -1;\n+\t\t\tbreak;\n+\t\tcase '?':\n+\t\t\t/* getopt is not happy, stop right now */\n+\t\t\tgoto out;\n+\t\tdefault:\n+\t\t\tcontinue;\n+\t\t}\n+\t}\n+out:\n+\t/* restore getopt lib */\n+\toptind = old_optind;\n+\toptopt = old_optopt;\n+\toptarg = old_optarg;\n+#ifdef RTE_EXEC_ENV_FREEBSD\n+\toptreset = old_optreset;\n+#endif\n+\treturn 0;\n+}\n+\n+/*\n+ * set the log to default function, called during eal init process,\n+ * once memzones are available.\n+ */\n+int\n+eal_log_init(const char *id, int facility)\n+{\n+\tFILE *log_stream;\n+\n+\tlog_stream = fopencookie(NULL, \"w+\", console_log_func);\n+\tif (log_stream == NULL)\n+\t\treturn -1;\n+\n+\topenlog(id, LOG_NDELAY | LOG_PID, facility);\n+\n+\teal_log_set_default(log_stream);\n+\n+\treturn 0;\n+}\ndiff --git a/lib/eal/unix/meson.build b/lib/eal/unix/meson.build\nindex cc7d67dd321d..37d07594df29 100644\n--- a/lib/eal/unix/meson.build\n+++ b/lib/eal/unix/meson.build\n@@ -6,6 +6,7 @@ sources += files(\n         'eal_file.c',\n         'eal_filesystem.c',\n         'eal_firmware.c',\n+        'eal_log.c',\n         'eal_unix_memory.c',\n         'eal_unix_thread.c',\n         'eal_unix_timer.c',\n",
    "prefixes": [
        "v5",
        "1/6"
    ]
}