Commit 8e63ce30 by Stéphane Graber

lxc_monitor: Check return value of write

parent fbbc1539
...@@ -93,11 +93,16 @@ int main(int argc, char *argv[]) ...@@ -93,11 +93,16 @@ int main(int argc, char *argv[])
fd = lxc_monitor_open(my_args.lxcpath[i]); fd = lxc_monitor_open(my_args.lxcpath[i]);
if (fd < 0) { if (fd < 0) {
ERROR("Unable to open monitor on path:%s", my_args.lxcpath[i]); ERROR("Unable to open monitor on path: %s", my_args.lxcpath[i]);
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
continue; continue;
} }
write(fd, "quit", 4); if (write(fd, "quit", 4) < 0) {
SYSERROR("Unable to close monitor on path: %s", my_args.lxcpath[i]);
ret = EXIT_FAILURE;
close(fd);
continue;
}
close(fd); close(fd);
} }
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment