[Skiboot] [PATCH] pflash: use atexit for musl compatibility

Joel Stanley joel at jms.id.au
Mon Jul 25 15:50:20 AEST 2016


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 at jms.id.au>
---
 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);
-- 
2.8.1



More information about the Skiboot mailing list