From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by dpdk.org (Postfix) with ESMTP id 392321B47B; Tue, 10 Jul 2018 12:46:42 +0200 (CEST) Received: by mail-lf0-f66.google.com with SMTP id a134-v6so17866098lfe.6; Tue, 10 Jul 2018 03:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P8Ckipd6erVWgRPE+w8rvSKOG0nv1Qtx3d+uEotxyJ0=; b=OEUcQLkwpXKVVVpSca764fPIqoR91pZQIOQFr71gEfnvQLuRig54jCrMDQnOvxnGtQ 3wTDAPhG6yKIyur3Y9FUKvLBgJ0oJKWXdVOFYNF49PpKUIOWIFCaKcSpr8RvPFyjceol YLShgpRMTHFVnfXqklIl5uP18CtAzJIkiHB2Lncr/ejfqzW5YuF6s3yj5xf4JmN5eu/4 EH0CWhtuD/XUS8zDo5cwQGwSWzh8WhpPPqTLqouS98zvYX/7OFA3kILl6T3Lfl//FCZi 8VYs5Ej/Vu+YZ6hvtosZIodlsTl3E1q9j/OqRUUGqQetsvyWjA9O3QF50d3W4IFXgPGS Qpgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P8Ckipd6erVWgRPE+w8rvSKOG0nv1Qtx3d+uEotxyJ0=; b=sw7qj7KfYx8NHI3zLsVTixtnJ9u8DqixjtgdB4mxv0y13HCpKDRyKUFR0aI3DXRYag 7mx7p2dMXDl6rUX2tbiA/B+7D7JUKWxDdz8CQmEwckNCWl07gKC3/iLfr83JA1LNtf5j 8AXo/qxKlLUIedDVscX2/uL7TwOhFG7IPtVpmek6Tn5zhYx1qo35cy+fjz0HEatWtKTt NSBAG0yrfrO40DM8vHKJvR7wl5loxqObkBo8X2uEFFW2tCpivu+W/KgJ7LY66OkXQauP LWOp2LYeCJmosL0vWLZGhsjnX5kOGC4lMRsNZNV0QmXClfnH2TUGRJjZ6nNWUoDAu/0D LAIg== X-Gm-Message-State: APt69E3TQpUcvp+x6oMJxdBy7jFkjYygyTxB81t7juf7LQYmP+b6nasW 98MXkoynbpPp8K0YFr/pmWZYCPSo X-Google-Smtp-Source: AAOMgpdqtRkUpoSXq6LwG3BAK0aEddCIRUZoffAqd07t1upewo+qGFwL4kUX0WA2k16m3VVrz3tJOQ== X-Received: by 2002:a19:8e5c:: with SMTP id q89-v6mr2327298lfd.35.1531219601683; Tue, 10 Jul 2018 03:46:41 -0700 (PDT) Received: from localhost.localdomain (89-68-114-161.dynamic.chello.pl. [89.68.114.161]) by smtp.gmail.com with ESMTPSA id q4-v6sm4591320lfj.81.2018.07.10.03.46.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 03:46:41 -0700 (PDT) From: Dariusz Stojaczyk To: dev@dpdk.org, Anatoly Burakov , Olivier Matz , stable@dpdk.org Cc: Dariusz Stojaczyk , thomas.monjalon@6wind.com Date: Tue, 10 Jul 2018 12:44:46 +0200 Message-Id: <20180710104447.16756-2-darek.stojaczyk@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180710104447.16756-1-darek.stojaczyk@gmail.com> References: <1528461427-164113-1-git-send-email-dariuszx.stojaczyk@intel.com> <20180710104447.16756-1-darek.stojaczyk@gmail.com> Subject: [dpdk-stable] [PATCH v2 2/3] eal/thread: fix return codes for rte_thread_setname() X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2018 10:46:42 -0000 From: Dariusz Stojaczyk The doc says this function returns negative errno on error, but it currently returns either -1 or positive errno. It was incorrectly assumed that pthread_setname_np() returns negative error numbers. It always returns positive ones, so this patch negates its return value before returning. Fixes: 3901ed99c2f8 ("eal: fix thread naming on FreeBSD") Cc: thomas.monjalon@6wind.com Cc: stable@dpdk.org Signed-off-by: Dariusz Stojaczyk Acked-by: Anatoly Burakov Reviewed-by: Olivier Matz --- Changes from v1: * split this patch into two parts lib/librte_eal/linuxapp/eal/eal_thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_thread.c b/lib/librte_eal/linuxapp/eal/eal_thread.c index f652ff988..b496fc711 100644 --- a/lib/librte_eal/linuxapp/eal/eal_thread.c +++ b/lib/librte_eal/linuxapp/eal/eal_thread.c @@ -176,7 +176,7 @@ int rte_sys_gettid(void) int rte_thread_setname(pthread_t id, const char *name) { - int ret = -1; + int ret = ENOSYS; #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) #if __GLIBC_PREREQ(2, 12) ret = pthread_setname_np(id, name); @@ -184,5 +184,5 @@ int rte_thread_setname(pthread_t id, const char *name) #endif RTE_SET_USED(id); RTE_SET_USED(name); - return ret; + return -ret; } -- 2.11.0