diff options
author | Alasdair Kergon <agk@redhat.com> | 2007-01-25 14:37:48 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2007-01-25 14:37:48 +0000 |
commit | 2e1b92e3ea19e4c10c6792a0fc32cd399335820b (patch) | |
tree | c68c13fa2920be3fd2bd3a3905863db9f1836227 /lib/filters/filter.c | |
parent | 232da7ecc7a01aa3df9b12c150f6a235a0859c0f (diff) | |
download | lvm2-2e1b92e3ea19e4c10c6792a0fc32cd399335820b.tar.gz lvm2-2e1b92e3ea19e4c10c6792a0fc32cd399335820b.tar.xz lvm2-2e1b92e3ea19e4c10c6792a0fc32cd399335820b.zip |
Add some missing close() and fclose() return code checks.
Fix exit statuses of reporting tools (2.02.19).
Diffstat (limited to 'lib/filters/filter.c')
-rw-r--r-- | lib/filters/filter.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/filters/filter.c b/lib/filters/filter.c index ade3e3a3..2723b708 100644 --- a/lib/filters/filter.c +++ b/lib/filters/filter.c @@ -204,7 +204,8 @@ static int _scan_proc_dev(const char *proc, const struct config_node *cn) if (cv->type != CFG_STRING) { log_error("Expecting string in devices/types " "in config file"); - fclose(pd); + if (fclose(pd)) + log_sys_error("fclose", proc_devices); return 0; } dev_len = strlen(cv->v.str); @@ -214,14 +215,16 @@ static int _scan_proc_dev(const char *proc, const struct config_node *cn) log_error("Max partition count missing for %s " "in devices/types in config file", name); - fclose(pd); + if (fclose(pd)) + log_sys_error("fclose", proc_devices); return 0; } if (!cv->v.i) { log_error("Zero partition count invalid for " "%s in devices/types in config file", name); - fclose(pd); + if (fclose(pd)) + log_sys_error("fclose", proc_devices); return 0; } if (dev_len <= strlen(line + i) && @@ -232,7 +235,10 @@ static int _scan_proc_dev(const char *proc, const struct config_node *cn) } } } - fclose(pd); + + if (fclose(pd)) + log_sys_error("fclose", proc_devices); + return 1; } |