master - coverity: checked_return of close
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a533892cd3bcb6abd0d0ee3f35f059850e540238 Commit: a533892cd3bcb6abd0d0ee3f35f059850e540238 Parent: b90014addca59b3a40a686fd73b27f7a40511660 Author: Zdenek Kabelac <[email protected]> AuthorDate: Wed Jun 28 14:40:35 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Jun 28 14:42:11 2017 +0200
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.
--- daemons/dmfilemapd/dmfilemapd.c | 4 ++-- tools/command.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-)
daemons/dmfilemapd/dmfilemapd.c +2 -2
@@ -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 ;
tools/command.c +2 -1
@@ -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; }