mirror of
https://github.com/troglobit/finit.git
synced 2026-10-08 08:24:43 +07: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:
@@ -43,13 +43,16 @@ static svc_t *__connect_shm(void)
|
||||
|
||||
list = finit_svc_connect();
|
||||
if (!list) {
|
||||
if (workaround)
|
||||
return workaround;
|
||||
|
||||
/* Linux not built with CONFIG_SYSVIPC, or libc does not support shmat()/shmget() */
|
||||
if (ENOSYS == errno)
|
||||
warn("Kernel does support SYSV shmat() IPC, error %d", errno);
|
||||
|
||||
/* Try to prevent PID 1 from aborting, issue #81 */
|
||||
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)
|
||||
workaround = calloc(MAX_NUM_SVC, sizeof(svc_t));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user