Commit 9d1be31
icastats: Ignore unknown user in summary and all report
If icastats is used with option '--summary' and it encounters a statistics
shared memory segment for a user that no longer exists, it fails with
'get_stats_sum: : Success'. This is because getpwuid() fails, but does not
set errno, so that perror prints 'Success'.
Instead of failing, just ignore such shared memory segments for users that
do no longer exist.
A similar problem exists with option '--all', it stops iterating over the
statistics shared memory segments if it finds one for a non existing user.
Continue the loop to return statistics for additional users.
Also fix a problem when stats_mmap() fails in the loop to close the directory
file descriptor before returning NULL.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>1 parent 75153fa commit 9d1be31
1 file changed
Lines changed: 4 additions & 6 deletions
File tree
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 266 | + | |
| 267 | + | |
270 | 268 | | |
271 | 269 | | |
272 | 270 | | |
| |||
324 | 322 | | |
325 | 323 | | |
326 | 324 | | |
327 | | - | |
| 325 | + | |
328 | 326 | | |
329 | | - | |
| 327 | + | |
330 | 328 | | |
331 | 329 | | |
332 | 330 | | |
| |||
0 commit comments