From patchwork Sun Jan 5 17:11:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1217801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-108450-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="J9wLuVoL"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47rQCT5fZfz9sR0 for ; Mon, 6 Jan 2020 04:11:17 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=RWL cLfhWjNCCQv3ZRbpf6LSQivJRpdDyHwKbCxugrcX4SMFQjsy0k+8rkcrDS2iWgB3 GdYx2utUX87cAqm8fdPoACe16utnrBI9q9kGc0fm8cREotUEnwjQuUsG5EUQdv1M /Xecr3CGSjafMNkO5oyOlk54bRBQAPEWytukcVso= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=3Ta6sFdl8 llXBupiAw7O/9Rf+UM=; b=J9wLuVoLX0lTmaBoHtnQHmszwqKDp9yVPR1mvLVpS 4K08RpSlCH1sTuAcL+PTl8/j41sYQ4jekW3BvvTtU88X9UYAezCatcodhrhmX0mJ fy9Augo8mVYXXuWV5VP4hFijePCl0Kt0WJQxGDbDTZvFJ/8fa7mZ7Hanyc9wlJkx ac= Received: (qmail 107135 invoked by alias); 5 Jan 2020 17:11:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 107127 invoked by uid 89); 5 Jan 2020 17:11:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=sk:return_, HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] hurd: Fix message reception for timer_thread Date: Sun, 5 Jan 2020 18:11:02 +0100 Message-Id: <20200105171102.1478774-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 Without a proper size, we get MACH_RCV_TOO_LARGE instead of MACH_MSG_SUCCESS. * sysdeps/mach/hurd/setitimer.c (timer_thread): Add return_code_type field to received message, and set the receive size in __mach_msg call. --- sysdeps/mach/hurd/setitimer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c index 4a6fd1fe33..b16f4ddd5d 100644 --- a/sysdeps/mach/hurd/setitimer.c +++ b/sysdeps/mach/hurd/setitimer.c @@ -80,6 +80,7 @@ timer_thread (void) struct { mach_msg_header_t header; + mach_msg_type_t return_code_type; error_t return_code; } msg; @@ -89,7 +90,7 @@ timer_thread (void) _hurd_itimerval. */ err = __mach_msg (&msg.header, MACH_RCV_MSG|MACH_RCV_TIMEOUT|MACH_RCV_INTERRUPT, - 0, 0, _hurd_itimer_port, + 0, sizeof(msg), _hurd_itimer_port, _hurd_itimerval.it_value.tv_sec * 1000 + _hurd_itimerval.it_value.tv_usec / 1000, MACH_PORT_NULL);