From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7425 invoked by alias); 3 Apr 2003 11:02:18 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 7409 invoked from network); 3 Apr 2003 11:02:17 -0000 Received: from unknown (HELO localhost.localdomain) (195.113.19.66) by sources.redhat.com with SMTP; 3 Apr 2003 11:02:17 -0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h33B2EqO013179; Thu, 3 Apr 2003 13:02:14 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.12.8/8.12.8/Submit) id h33B2EYQ013075; Thu, 3 Apr 2003 13:02:14 +0200 Date: Thu, 03 Apr 2003 11:02:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Fix get_proc_path Message-ID: <20030403110213.GQ16629@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-04/txt/msg00014.txt.bz2 Hi! atomic_compare_and_exchange_bool_acq returns non-zero if it failed to exchange. This fixes getconf _NPROCESSORS_ONLN on my box. 2003-04-03 Jakub Jelinek * sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path): Reverse test for atomic_compare_and_exchange_bool_acq failure. --- libc/sysdeps/unix/sysv/linux/getsysstats.c.jj 2003-03-21 05:17:37.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/getsysstats.c 2003-04-03 05:31:09.000000000 -0500 @@ -85,7 +85,7 @@ get_proc_path (char *buffer, size_t bufs /* Now store the copied value. But do it atomically. */ assert (sizeof (long int) == sizeof (void *__unbounded)); - if (! atomic_compare_and_exchange_bool_acq (&mount_proc, copy_result, NULL)) + if (atomic_compare_and_exchange_bool_acq (&mount_proc, copy_result, NULL)) /* Replacing the value failed. This means another thread was faster and we don't need the copy anymore. */ free (copy_result); Jakub