Refactor common code into execute_script().
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 18661 Build 18346: arc lint + arc unit
Event Timeline
sbin/init/init.c | ||
---|---|---|
642 | 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 | 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 | I recomment to bzero() sa before setting the fields. I know that it is not present in the moved code. | |
1062 | Just use NULL for the last arg. | |
1067 | NULL. | |
1899–1900 | 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 | 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.