aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2016-07-25 15:20:20 +0930
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-28 13:45:16 +1000
commit72c551ff9d163a65087ca0865e736456f291995a (patch)
tree0976a57bc5b669f88125f1b7f8596e7600fab777
parenta6c78e5416a1bc69184ee7669de8eb8f43f6dbed (diff)
downloadskiboot-72c551ff9d163a65087ca0865e736456f291995a.zip
skiboot-72c551ff9d163a65087ca0865e736456f291995a.tar.gz
skiboot-72c551ff9d163a65087ca0865e736456f291995a.tar.bz2
pflash: use atexit for musl compatibility
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 <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--external/pflash/pflash.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
index c124356..2700046 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);