1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

coverity 83687 daemonize was not a close problem

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2014-11-30 13:47:36 +08:00
parent b03430745b
commit 0c5f6709a8

View file

@ -105,7 +105,7 @@ lws_daemonize(const char *_lock_path)
return 1;
fd = open(_lock_path, O_RDONLY);
if (fd > 0) {
if (fd >= 0) {
n = read(fd, buf, sizeof(buf));
close(fd);
if (n) {
@ -121,7 +121,6 @@ lws_daemonize(const char *_lock_path)
_lock_path, n);
unlink(lock_path);
}
close(fd);
}
n = strlen(_lock_path) + 1;