check return value of SCK_OpenUnixSocketPair()

This commit is contained in:
Miroslav Lichvar 2020-04-20 15:42:45 +02:00
parent 105b3faa46
commit 7fc5da5f80
2 changed files with 4 additions and 0 deletions

View file

@ -663,6 +663,8 @@ NKS_Initialise(int scfilter_level)
int sock_fd1, sock_fd2;
sock_fd1 = SCK_OpenUnixSocketPair(0, &sock_fd2);
if (sock_fd1 < 0)
LOG_FATAL("Could not open socket pair");
for (i = 0; i < processes; i++)
start_helper(i + 1, scfilter_level, sock_fd1, sock_fd2);

View file

@ -644,6 +644,8 @@ PRV_StartHelper(void)
LOG_FATAL("Helper already running");
sock_fd1 = SCK_OpenUnixSocketPair(SCK_FLAG_BLOCK, &sock_fd2);
if (sock_fd1 < 0)
LOG_FATAL("Could not open socket pair");
pid = fork();
if (pid < 0)