mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
Take down condition subsystem at shutdown/reboot
Leave the system as it was when we found it. Also, we'll build things on top of cond_is_available() to handle pre bootstrap and pre shutdown tasks. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
585ac51f45
commit
5f74adad06
3 files changed
+20
No files matched your search
@@ -410,6 +410,15 @@ void cond_deassert(const char *pat)
|
||||
nftw(cond_path(pat), deassert, 20, FTW_DEPTH);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if we have bootstrapped enough of the system to use conditions.
|
||||
* Will answer 'No' before bootstrap done *and* at shutdown/reboot.
|
||||
*/
|
||||
int cond_is_available(void)
|
||||
{
|
||||
return fisdir(_PATH_COND);
|
||||
}
|
||||
|
||||
void cond_init(void)
|
||||
{
|
||||
char path[MAX_ARG_LEN];
|
||||
@@ -423,6 +432,11 @@ void cond_init(void)
|
||||
cond_boot_strap();
|
||||
}
|
||||
|
||||
void cond_exit(void)
|
||||
{
|
||||
cond_delpath(_PATH_COND);
|
||||
}
|
||||
|
||||
/**
|
||||
* Local Variables:
|
||||
* indent-tabs-mode: t
|
||||
|
||||
@@ -46,7 +46,10 @@ int cond_clear_noupdate(const char *name);
|
||||
void cond_reassert (const char *pat);
|
||||
void cond_deassert (const char *pat);
|
||||
|
||||
int cond_is_available(void);
|
||||
|
||||
void cond_init (void);
|
||||
void cond_exit (void);
|
||||
|
||||
#endif /* FINIT_COND_H_ */
|
||||
|
||||
|
||||
Reference in new issue
Block a user