mirror of
https://github.com/troglobit/finit.git
synced 2026-11-09 16:21:24 +00:00
Follow-up to issue #81, don't append error message again.
Also, when called multiple times, return workaround immediately instead of warning again. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
3d4e3c99ed
commit
53de1c8575
1 file changed
+4
-1
@@ -43,13 +43,16 @@ static svc_t *__connect_shm(void)
|
|||||||
|
|
||||||
list = finit_svc_connect();
|
list = finit_svc_connect();
|
||||||
if (!list) {
|
if (!list) {
|
||||||
|
if (workaround)
|
||||||
|
return workaround;
|
||||||
|
|
||||||
/* Linux not built with CONFIG_SYSVIPC, or libc does not support shmat()/shmget() */
|
/* Linux not built with CONFIG_SYSVIPC, or libc does not support shmat()/shmget() */
|
||||||
if (ENOSYS == errno)
|
if (ENOSYS == errno)
|
||||||
warn("Kernel does support SYSV shmat() IPC, error %d", errno);
|
warn("Kernel does support SYSV shmat() IPC, error %d", errno);
|
||||||
|
|
||||||
/* Try to prevent PID 1 from aborting, issue #81 */
|
/* Try to prevent PID 1 from aborting, issue #81 */
|
||||||
if (getpid() == 1) {
|
if (getpid() == 1) {
|
||||||
warn("Implementing PID 1 workaround, initctl tool will not work ...");
|
warnx("Implementing PID 1 workaround, initctl tool will not work ...");
|
||||||
if (!workaround)
|
if (!workaround)
|
||||||
workaround = calloc(MAX_NUM_SVC, sizeof(svc_t));
|
workaround = calloc(MAX_NUM_SVC, sizeof(svc_t));
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user