X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Frunas.c;h=4bd356a0499f2119a227a69b324ab5248d7ba8a0;hp=f3adf7355444fe8a8961f1132151110b891fc4ba;hb=938c57de605e65da12654a4963e466eb3ea4a85e;hpb=9abb7e4a8758e6894872d81aef285aa2b521318a diff --git a/src/common/runas.c b/src/common/runas.c index f3adf7355..4bd356a04 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -402,11 +402,14 @@ int send_fd_to_master(struct run_as_worker *worker, enum run_as_cmd cmd, int fd) ret = -1; } + if (fd < 0) { + goto end; + } ret_close = close(fd); if (ret_close < 0) { PERROR("close"); } - +end: return ret; } @@ -809,7 +812,6 @@ int run_as(enum run_as_cmd cmd, struct run_as_data *data, DBG("Socket closed unexpectedly... " "Restarting the worker process"); ret = run_as_restart_worker(global_worker); - if (ret == -1) { ERR("Failed to restart worker process."); goto err;