output Exit when new service exit

This commit is contained in:
Cloud Wu
2016-05-06 19:45:50 +08:00
parent 84b08bf286
commit 6cc558bb82

View File

@@ -143,7 +143,11 @@ end
function COMMAND.start(fd, ...) function COMMAND.start(fd, ...)
local ok, addr = pcall(skynet.newservice, ...) local ok, addr = pcall(skynet.newservice, ...)
if ok then if ok then
return { [skynet.address(addr)] = ... } if addr then
return { [skynet.address(addr)] = ... }
else
return "Exit"
end
else else
return "Failed" return "Failed"
end end
@@ -152,7 +156,11 @@ end
function COMMAND.log(fd, ...) function COMMAND.log(fd, ...)
local ok, addr = pcall(skynet.call, ".launcher", "lua", "LOGLAUNCH", "snlua", ...) local ok, addr = pcall(skynet.call, ".launcher", "lua", "LOGLAUNCH", "snlua", ...)
if ok then if ok then
return { [skynet.address(addr)] = ... } if addr then
return { [skynet.address(addr)] = ... }
else
return "Failed"
end
else else
return "Failed" return "Failed"
end end