From patchwork Tue Sep 12 12:35:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 812819 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4010:c07::23d; helo=mail-lf0-x23d.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbqvk37gqkgqeucmmiza@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="FgrEe1P4"; dkim-atps=neutral Received: from mail-lf0-x23d.google.com (mail-lf0-x23d.google.com [IPv6:2a00:1450:4010:c07::23d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xs49m6XY4z9t2l for ; Tue, 12 Sep 2017 22:38:29 +1000 (AEST) Received: by mail-lf0-x23d.google.com with SMTP id a18sf356812lfl.0 for ; Tue, 12 Sep 2017 05:38:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1505219906; cv=pass; d=google.com; s=arc-20160816; b=Qb0MuDjSwy/NOdhPkH+fl60d8QmR2M8any0PVlOgqS8qENAuU5XEj/30ZWIk5D4H7A d5SPtjwbcsTXImQ0Qj3Tit4ZrRjeBsLz/wODpLYsLW2yoWSUsIsdQHsVAReniHtVrd3H 0cqsQqKE8LbR8mK4hrKGHMoY5RQ6jziX2pTFbJQymEG3r3d6SKOSGI41zhhdap4TVwk8 IeDtNW37eCaoF9anPX6RC5++T2/IKm6FV1X5++4PjNb8IYqpDUnvXNt7NkLPf8J0nOha aPBJ2ymEj92pRseyWK+lXTXk1qAUSH8mFKg+vJSqz8iYKHwhYtJ8FydM4tnD6ZTivOj+ JQ7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=0X7qngHlMeC4NvZNth1Wb36WULO5Uj6ieGZ6GLKLb0k=; b=hSl40epv6rkeuf8FyXdvGtURIr9m/besR4puDAldofB5JOgJdf7xjEGRLyUp5CmOay 4Rm2X73JDwc8+40rugWOhFmPfI6BBRV62T6/3Mt6VS7hoRe0A/k7So7RJ1zgMZ3ByUf8 4lnNjd32gUvJ0ZfYFsPKyLNF6YM5UqCVkqu+QsD8qfRbHb9iTlUoQ93Sunq+fs51MKsN l6MJcI7Wtmcgx1xL0nRlK05m+aI17e04rTPqniTc1zh75GQVKyVwi+g0ZmQ5LHh9c/90 DrYqy0QmcDAikPYlQXK6OGKuUXKGyyEan1kxfSsRV8nC4gr7QsR11Bxzbr2YAoXA9JR7 QFXQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=0X7qngHlMeC4NvZNth1Wb36WULO5Uj6ieGZ6GLKLb0k=; b=FgrEe1P4Z/HSh2XFrXFH91KkX7zOOchR6CP45iyCR+e6QHsvUtBpHOMqZXSMK1fjGA rNAm2bEfN11derPuhSyZBp3H22iKaxuJdISu33+ldSmJrVxabRzFSUFpd+iNkbJQX2NT AJXLZWfn2IR440emRvdCojXqctsf/dBSmsA7GbgRGWNlMqjKmv48Fu5mxqODm+JdI1UO PVY1hdS7qGq53H43Pizc9yBwomOMvp/SjB8bZHIsgjqH7MfZGncaJCGqB60JTAVNCVUE woh2YzNTJz+Vi3VnoLHbtGgLO5M0fMcxiZh8y1BvzRbTmZ4Vo/HlxrPsIsKckB7MvXD2 IOaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=0X7qngHlMeC4NvZNth1Wb36WULO5Uj6ieGZ6GLKLb0k=; b=soCoQV9J4YV0tPfWDNBUAcgfF3gcH8u1HS/l9GczbUSzQXwKlZDmQeI9pDYHhE6ZtL j1lJhZYWOn3UP+FSczi8YJuR828eNdD135soeHjQcdF8LG7RfvNsb8JfapXJ3v783YVF pISjLPVWxGztIzJfwotO4Zi5VH2GRTjm6S3hahZVBz4xHxIxm+v00FaYCvetLO4NVJVx g7+Ik4jwXIGUMB0vXIHEM2HQuKsbXJ/tbaj3YnY9wadRcypOPl4ov+fneopboG8gnjfj Ph6Pkkve1ooU6o2YS+QDsgJCgbOK2mZXDu+KlWb49BHGbK45qf2HblEHDg8gHlU+NFrT sMnw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AHPjjUgD/tSH+f13I9Xs0wDvoapovMHB25gM+VPXYyfl5HcF8Kmai7VZ uIska9zboHJzyg== X-Google-Smtp-Source: AOwi7QD/DTtLDQUkXNkYWVFnQ5pWUn/hn/Fb4aQmfni8kADwFP4O3iUpbh45fWc3HxOsKR/O1dZYlQ== X-Received: by 10.46.69.87 with SMTP id s84mr30725lja.27.1505219906662; Tue, 12 Sep 2017 05:38:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.46.76.9 with SMTP id z9ls100037lja.24.gmail; Tue, 12 Sep 2017 05:38:26 -0700 (PDT) X-Received: by 10.25.190.75 with SMTP id o72mr926914lff.18.1505219906183; Tue, 12 Sep 2017 05:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505219906; cv=none; d=google.com; s=arc-20160816; b=wecejA2FqwWktJxbGcRkMEfASXrVrqGKIQFxc+AbGe/Or0sJfWQQ42t0ZAexlXPQUh fxai98pi1WddcEY77HFuqiBJOjWGEKeKQfY3D0m8WRsAG15o49m+5qrFUF+L3WkLFWOy Hmjpg7bg9CrZ/Tx4zrlO7UOgyBXPNltfKg5CGGCv3tjJpeZTACjXiqU6+DneyOM2T0Ub soqmSNmI1Qz/xDJYMvZurpe/6dNHSrxW/mTfnhDx5PY2GeZuxfaVmWasLVX+Gpgg/RNt PUz1Z/17eYs7urNfMrmI6cHUIOpucJkk1hc2qtADKyRABvw9rTOPK6dGoRqUdztb3w3D AmSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=Uhe5lhb9yZ/ncCjlNiYgr9cAKKZK8Mkbwxm/7S/Zit4=; b=JVwfCC8XcY1/e8H7writI2Kn89kTF1UkkcFDfUXYnkbmxPayHA1nTZmQ1qLexzBSzo Pecbc8JfyWap4PVRCI4iBHhGmAV26HzmIroVeeAaq4X9T8n21XdAcHjpnIR7taWdsx3R q+RbnZrkvCGcGcd5ORsR4Mk7M3mDZEqckxxBn58/dz97jIg4fDEEQwZDpDlaDzeawBLF qvfKVkzTS9Z7a+b4F+y95WYFayg8ekHl72GUWgszbd+9zsVST+j1swCszbKY5AionsBt kA+5kkCWpin6W4rsIrqQlPDG7x42UyXKiN8nbG4MNTJtI6+eLIGnQwyZtiUSNy00W56l 3iRw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id 74si861959wmf.8.2017.09.12.05.38.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 05:38:26 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) client-ip=192.35.17.2; Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v8CCcPYd025682 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 12 Sep 2017 14:38:25 +0200 Received: from MD1KR9XC.ad001.siemens.net ([139.25.69.251]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id v8CCcPX4023136; Tue, 12 Sep 2017 14:38:25 +0200 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] tmpdir: fix asprintf return value check Date: Tue, 12 Sep 2017 14:35:54 +0200 Message-Id: <20170912123554.7388-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.14.1 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of christian.storm@siemens.com) smtp.mailfrom=christian.storm@siemens.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Fix travis's complaint about missing asprintf return value check (-Wunused-result). Signed-off-by: Christian Storm Reviewed-by: Stefano Babic --- core/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/util.c b/core/util.c index 8c6b295..821b6df 100644 --- a/core/util.c +++ b/core/util.c @@ -71,7 +71,9 @@ const char* get_tmpdir(void) return TMPDIR; } - asprintf(&TMPDIR, "%s/", env_tmpdir); + if (asprintf(&TMPDIR, "%s/", env_tmpdir) == -1) { + TMPDIR = (char*)"/tmp/"; + } return TMPDIR; }