1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

coverity: checked_return of close

Check (or make quiet) close() ret code.
NOTE: there is another duplicated code of daemonize function which
should be converted to libdaemon.
This commit is contained in:
Zdenek Kabelac 2017-06-28 14:40:35 +02:00
parent b90014addc
commit a533892cd3
2 changed files with 4 additions and 3 deletions

View File

@ -662,11 +662,11 @@ static int _daemonise(struct filemap_monitor *fm)
return 0;
}
}
/* TODO: Use libdaemon/server/daemon-server.c _daemonise() */
for (fd = (int) sysconf(_SC_OPEN_MAX) - 1; fd > STDERR_FILENO; fd--) {
if (fd == fm->fd)
continue;
close(fd);
(void) close(fd);
}
return 1;

View File

@ -3304,7 +3304,8 @@ static int include_description_file(char *name, char *des_file)
out_free:
dm_free(buf);
out_close:
close(fd);
if (close(fd))
log_sys_debug("close", des_file);
return r;
}