소스 검색

Use SD_LISTEN_FDS_START constant

Avoid magical numbers as it makes it hard to understand the code.
pull/1722/head
Pierre Ossman 4 달 전
부모
커밋
166c287a8a
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2
    4
      unix/x0vncserver/x0vncserver.cxx

+ 2
- 4
unix/x0vncserver/x0vncserver.cxx 파일 보기

@@ -121,10 +121,8 @@ static int createSystemdListeners(std::list<SocketListener*> *listeners)
{
int count = sd_listen_fds(0);

for (int i = 0; i < count; ++i) {
/* systemd sockets start at FD 3 */
listeners->push_back(new TcpListener(3 + i));
}
for (int i = 0; i < count; ++i)
listeners->push_back(new TcpListener(SD_LISTEN_FDS_START + i));

return count;
}

Loading…
취소
저장