mirror of
https://github.com/troglobit/finit.git
synced 2026-10-19 11:09:35 +00:00
Fix filesystems not unmounted at shutdown
Instead of unconditionally waiting 2 seconds for processes to die, check continuously for remaining processes, and break the loop when none remain. Turn PID 1 to a RT process with highest priority 99 during shutdown, this ensures it would not be preempted by other RT processes. Signed-off-by: Robert Andersson <robert.m.andersson@atlascopco.com> Signed-off-by: Mathias Thore <mathias.thore@atlascopco.com> Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This commit is contained in:
1 parent
6ec1ab3d4f
commit
3e0063e874
3 files changed
+70
-5
No files matched your search
+14
@@ -297,6 +297,20 @@ void do_sleep(unsigned int sec)
|
||||
;
|
||||
}
|
||||
|
||||
void do_usleep(unsigned int usec)
|
||||
{
|
||||
struct timespec deadline;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &deadline);
|
||||
|
||||
deadline.tv_nsec += usec * 1000;
|
||||
deadline.tv_sec += deadline.tv_nsec / 1000000000;
|
||||
deadline.tv_nsec = deadline.tv_nsec % 1000000000;
|
||||
|
||||
while (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &deadline, NULL) != 0 && errno == EINTR)
|
||||
;
|
||||
}
|
||||
|
||||
/* Seconds since boot, from sysinfo() */
|
||||
long jiffies(void)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user