Prevent setsid() failure from taking down ycmd

This commit is contained in:
Strahinja Val Markovic 2014-04-10 13:02:49 -07:00
parent 1721597f0c
commit 479ad62555

View File

@ -113,7 +113,11 @@ def Main():
# If not on windows, detach from controlling terminal to prevent
# SIGINT from killing us.
if not utils.OnWindows():
try:
os.setsid()
# setsid() can fail if the user started ycmd directly from a shell.
except OSError:
pass
# This can't be a top-level import because it transitively imports
# ycm_core which we want to be imported ONLY after extra conf