From: Lionel Sambuc Date: Tue, 13 May 2014 15:26:56 +0000 (+0200) Subject: libsys/sef.c: cleanup around sef_exit X-Git-Tag: v3.3.0~255 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch01.html?a=commitdiff_plain;h=f88b0001bab9a139045c7982e77f380e8b244002;p=minix.git libsys/sef.c: cleanup around sef_exit - use weak_alias for _exit and __exit instead of stub functions - remove fallback on PM_EXIT, as sys_exit can't fail, and we busy loop afterwards if that fails too. There is no reason that a PM_EXIT would work for a driver or server when sys_exit failed anyway. Change-Id: I0327fb5c6fba25687cc9dc99fbf9c6d4db7d26e8 --- diff --git a/lib/libsys/sef.c b/lib/libsys/sef.c index 010d50aef..46817934c 100644 --- a/lib/libsys/sef.c +++ b/lib/libsys/sef.c @@ -230,35 +230,15 @@ void sef_exit(int status) /* Ask the kernel to exit. */ sys_exit(); - /* If sys_exit() fails, this is not a system service. Exit through PM. */ - memset(&m, 0, sizeof(m)); - m.PM_EXIT_STATUS = status; - _syscall(PM_PROC_NR, PM_EXIT, &m); - /* If everything else fails, hang. */ printf("Warning: system service %d couldn't exit\n", sef_self_endpoint); for(;;) { } } -/*===========================================================================* - * _exit * - *===========================================================================*/ -void _exit(int status) -{ -/* Make exit() an alias for sef_exit() for system services. */ - sef_exit(status); - panic("sef_exit failed"); -} - -/*===========================================================================* - * __exit * - *===========================================================================*/ -void __exit(int status) -{ -/* Make exit() an alias for sef_exit() for system services. */ - sef_exit(status); - panic("sef_exit failed"); -} +#ifdef __weak_alias +__weak_alias(_exit, sef_exit); +__weak_alias(__exit, sef_exit); +#endif #if SEF_INIT_DEBUG || SEF_LU_DEBUG || SEF_PING_DEBUG || SEF_SIGNAL_DEBUG /*===========================================================================*