From patchwork Mon Jul 25 05:50:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 652168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ryVjD4Vcjz9t15 for ; Mon, 25 Jul 2016 15:50:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=qIduRFBE; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3ryVjD3SQ2zDqhR for ; Mon, 25 Jul 2016 15:50:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=qIduRFBE; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3ryVj454gZzDqcn for ; Mon, 25 Jul 2016 15:50:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=qIduRFBE; dkim-atps=neutral Received: by mail-pf0-x243.google.com with SMTP id h186so11265942pfg.2 for ; Sun, 24 Jul 2016 22:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id; bh=RbmnJOjhKO2WBapesHWmLaD0vupM8dTnM1bTUIhFK/c=; b=qIduRFBEsiNn5c4jIxC+yu9kumw2jKw5VGcx1EPq5S/VF5UPjWQ1vKb6/7muXgY6Vf vUHderrOjHTYe8y3S7H/zfg23JagNAcq7cs358y5C/ZlwjoorcMhMiIA81lPy5S9doSY fvrTk9QmqudIbsc1lUvCwYwumxKP0dFOfo4wC0IESDtbnX48GQGEhsQ1orpYtNevQUXQ mi6gspsAJHCp5gYqrvK0uqXns5nYMncjR/Z8U2Gw75Fn0it5RlQeumosGL+moW/P0MSz wrQ4Otwm/LPj9YGr3eV5lGaLL9cREOVe6NS6xyOg8VOyq0VIigmtFgS9BT2TfZp/z9M1 EpNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id; bh=RbmnJOjhKO2WBapesHWmLaD0vupM8dTnM1bTUIhFK/c=; b=gRDzEDpAhLgv1VaVFzvH9TdKNwhQ18PBPSaOTWigSs+dgPMof9blNDknJLmhsh1mKL o02o4ZZjW4GhCCy8rUOd9p8DpF2rQbPdFkpuPtdkQsp1I3QP5al/d35g7cGwKGVAKxqh arRk3MByRDXHkyD1UHx5EVb+y1mK/PMAqLC5UC5gLE1q2e8rU7SeQ4jpUfJcpRSurbyE w8qiYQIBoD2nRC1kYfOMvgo+q7BY+3HHGEKZHAopkl10nw65r32OTy1P1v91KkqRYWb7 VGLfackXwURVUSBEf6EBKK7ay7K7r0MnnsplJ/C3kKwBTL93x7PjcZXeFrzKUCB5JfOw wMjw== X-Gm-Message-State: AEkoousipAIDGWUK79cTyw1VgCu+UzaunifCDee3L9iarZQ8EwLw1ybFcsBwQzF2aGRZyw== X-Received: by 10.98.10.71 with SMTP id s68mr26723114pfi.110.1469425830828; Sun, 24 Jul 2016 22:50:30 -0700 (PDT) Received: from aurora.jms.id.au ([203.0.153.9]) by smtp.gmail.com with ESMTPSA id d3sm36459716pfk.37.2016.07.24.22.50.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 24 Jul 2016 22:50:30 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Mon, 25 Jul 2016 15:20:23 +0930 From: Joel Stanley To: skiboot@lists.ozlabs.org Date: Mon, 25 Jul 2016 15:20:20 +0930 Message-Id: <1469425820-16758-1-git-send-email-joel@jms.id.au> X-Mailer: git-send-email 2.8.1 Subject: [Skiboot] [PATCH] pflash: use atexit for musl compatibility X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" I accidentally built myself a cross-toolchain with the musl libc. It does not support on_exit which we use to clean up in pflash. Instead use atexit with is supported by both uclibc, musl and glibc. Signed-off-by: Joel Stanley --- external/pflash/pflash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c index c124356fd3d9..27000469052e 100644 --- a/external/pflash/pflash.c +++ b/external/pflash/pflash.c @@ -509,7 +509,7 @@ static void print_help(const char *pname) printf("\t\tThis message.\n\n"); } -void exiting(int d, void *p) +void exiting(void) { if (need_relock) arch_flash_set_wrprotect(bl, 1); @@ -775,8 +775,7 @@ int main(int argc, char *argv[]) exit(1); } - on_exit(exiting, NULL); - + atexit(exiting); rc = blocklevel_get_info(bl, &fl_name, &fl_total_size, &fl_erase_granule);