Message ID | 1469425820-16758-1-git-send-email-joel@jms.id.au |
---|---|
State | Accepted |
Headers | show |
Joel Stanley <joel@jms.id.au> writes: > 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> Thanks, merged to master as of 72c551ff9d163a65087ca0865e736456f291995a
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);
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> --- external/pflash/pflash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)