The nxspawn_dup2 function will return a value greater than 0, so the loop should only exit if ret is less than 0. Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>