Refactor common code into execute_script().
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sbin/init/init.c | ||
---|---|---|
642 ↗ | (On Diff #46414) | Is there a reason for re-evaluation of the kenv on each call to get_shell ? Can you initialize it early and then use the static string ? |
1058 ↗ | (On Diff #46414) | There are too many blank lines, all of them are excessive. Keep only the line before multi-line comment, and right after the block which was commented. |
1059 ↗ | (On Diff #46414) | I recomment to bzero() sa before setting the fields. I know that it is not present in the moved code. |
1062 ↗ | (On Diff #46414) | Just use NULL for the last arg. |
1067 ↗ | (On Diff #46414) | NULL. |
1904 ↗ | (On Diff #46414) | This shell instance seems to be only used in warnings. Either pass shell as the argument to execute_script() or modify warnings. |
sbin/init/init.c | ||
---|---|---|
642 ↗ | (On Diff #46414) | It's documented to do that in init(8), previously in loader(8): The value of the corresponding kenv(2) variable is evaluated every time init calls a shell script, so it can be changed later on using the kenv(1) utility. In particular, if a non-default shell is used for running an init_script, it might be desirable to have that script reset the value of init_shell back to the default, so that the /etc/rc script is executed with the standard shell /bin/sh. |
This is fine.
BTW, %m special handling in libc/gen/syslog.c now can be removed, since fprintfv() has the %m built-in. I was initially confused to realize that %m in init.c was used for very long time.