Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp323346pxt; Fri, 6 Aug 2021 03:00:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsoKYXrRBpUMhoK7f7uGPZxfduJ3XFISrfoEFJBoHpp10IYFvg5XtmyQL5oU6hDMyoTSgz X-Received: by 2002:a17:906:9c84:: with SMTP id fj4mr8966007ejc.274.1628244000609; Fri, 06 Aug 2021 03:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628244000; cv=none; d=google.com; s=arc-20160816; b=RWcsjbW65Ac9UYsRSIts82Eh3SduVzBiYntf8tKf5HINEyy/N7Xv1c3ZdCQx3ynxlU K2QRh+Pvh/uQtP/IuDzl5qMbPYhgo4g0CTk/J5sDneUJdI9w8ZSdAbx+n81JxgfGB7FB AoHZ33WISI+Wc7XqT56evZcc/NLoSkUC6qZYGNu/sTbDHG1SZQVva7bpS02Q6T+fFoB5 3NXMkDaACva+Fv3ZX/yp4oE7ytZTtORNIEEsHzYpeKtW+TKFU0Mada5A8oIBJvu/AmfB MJJ7eyLXV//zm3j3oCkJyvTLRyZeTiSbFNNEp7wBU+SZbkal9Z+FQGm6umr6k+Gu36i0 sJOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n1mxHwvV4s0WmY6mJwpU5NBAe57HY2UnEei7jangg1k=; b=xq6u6CrzAPXox8E/Myilxmtzisdvb8XOKcPQHOhie4ENNZZi4b4+kdHRtpFVPY9AeM 5WGrHnDVM3m63RFvL1vyC7qEGQtoaiaCEjngQKxjw0dDdncXLyje4Z3oKiszj8UuJjyi F1jDtT02BtXgMON8nbawA7mOVa1gHbaZbl4Gqgg68vmApHzhfOCJmesJNipvk3vDGtvf T7GQy3bybUC6zDhpNd/gS1zNocW0RAAkVrRIkwJ0LVPA9ckERmE6rJa9t7sSB06Ba3pe W9Ub7ZQWRArLn/5QnSSCpI3wbocpQTLpS6Td599hiUDYPEyyU8ONbwPgM6SFQVcfF26N 0TRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aR+9s7WE; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si8495563ejd.412.2021.08.06.02.59.36; Fri, 06 Aug 2021 03:00:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aR+9s7WE; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244785AbhHFJ6y (ORCPT + 99 others); Fri, 6 Aug 2021 05:58:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28725 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbhHFJ6t (ORCPT ); Fri, 6 Aug 2021 05:58:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628243914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n1mxHwvV4s0WmY6mJwpU5NBAe57HY2UnEei7jangg1k=; b=aR+9s7WEqRcisHvl4gueHZs7RnxkUws9JHdy+Fhml5Vv+zaQf3rbiHrhY7bHDvfA24/tj4 5Je4dZfNtDYYY7puUPKyr+dFiSE0K1IJRK/EXhQgikjekENejigmPwT8WnpopBrJooYE11 HyjqNBNiVlJzr53TczFWxbHZ6SRklpY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-532-YuBw2uo1NzO0pK_QSiR2hA-1; Fri, 06 Aug 2021 05:58:32 -0400 X-MC-Unique: YuBw2uo1NzO0pK_QSiR2hA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CE2BA801AE7; Fri, 6 Aug 2021 09:58:31 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2009281F7D; Fri, 6 Aug 2021 09:58:30 +0000 (UTC) From: Lukas Czerner To: tytso@mit.edu Cc: linux-ext4@vger.kernel.org Subject: [PATCH 6/7] libss: Add missing error handling for fdopen() Date: Fri, 6 Aug 2021 11:58:19 +0200 Message-Id: <20210806095820.83731-6-lczerner@redhat.com> In-Reply-To: <20210806095820.83731-1-lczerner@redhat.com> References: <20210806095820.83731-1-lczerner@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Signed-off-by: Lukas Czerner --- lib/ss/list_rqs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c index 021a3835..89e37bb2 100644 --- a/lib/ss/list_rqs.c +++ b/lib/ss/list_rqs.c @@ -12,6 +12,9 @@ */ #include "config.h" #include "ss_internal.h" +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include @@ -46,6 +49,12 @@ void ss_list_requests(int argc __SS_ATTR((unused)), return; } output = fdopen(fd, "w"); + if (!output) { + perror("fdopen"); + close(fd); + (void) signal(SIGINT, func); + return; + } sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0); fprintf (output, "Available %s requests:\n\n", -- 2.31.1