From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 144D93858016 for ; Wed, 28 Sep 2022 14:17:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 144D93858016 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664374676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H4t4uNlXWuFO4Uxggkd9mx5drm4qBA9TvJtyQpkgwF4=; b=jTTmY9K+mzqTlc4znZFvzh/AWpxeXlzSB/zqk5jP8DyMO6M56mMcxBywctTduPuYhw+jDf 8oGsWUjFY4mTo+zieuMAKlJ8qcYtN5Xr7iQa8iqUHSGu/LK4Z2RSLRx2LgYpqs/HtTLH3n L/g5lcYI0YaXgiBe4KRdo5q1/s7BNJo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-645-RjkQx73sPfCXFiWOt2WVXQ-1; Wed, 28 Sep 2022 10:17:55 -0400 X-MC-Unique: RjkQx73sPfCXFiWOt2WVXQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 24CB78027F5 for ; Wed, 28 Sep 2022 14:17:55 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.17.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFBFB7AE5; Wed, 28 Sep 2022 14:17:54 +0000 (UTC) From: Aaron Merey To: elfutils-devel@sourceware.org Cc: Aaron Merey Subject: [OB PATCH] debuginfod-client: Ensure only negative error codes returned. Date: Wed, 28 Sep 2022 10:17:53 -0400 Message-Id: <20220928141753.333722-1-amerey@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Committing as obvious: Switch a couple error codes from positive to negative so they aren't interpreted as file descriptors by the caller. Signed-off-by: Aaron Merey --- debuginfod/ChangeLog | 5 +++++ debuginfod/debuginfod-client.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 680720ff..8fb65133 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,8 @@ +2022-09-28 Aaron Merey + + * debuginfod-client.c (debuginfod_query_server): Switch sign of some + error codes from positive to negative. + 2022-09-08 Frank Ch. Eigler * debuginfod-client.c (debuginfod_query_server): Clear diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 28ad04c0..2a14d9d9 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -1085,7 +1085,7 @@ debuginfod_query_server (debuginfod_client *c, c->winning_headers = NULL; if ( maxtime > 0 && clock_gettime(CLOCK_MONOTONIC_RAW, &start_time) == -1) { - rc = errno; + rc = -errno; goto out2; } long delta = 0; @@ -1096,7 +1096,7 @@ debuginfod_query_server (debuginfod_client *c, { if (clock_gettime(CLOCK_MONOTONIC_RAW, &cur_time) == -1) { - rc = errno; + rc = -errno; goto out2; } delta = cur_time.tv_sec - start_time.tv_sec; -- 2.37.3