diff options
| -rw-r--r-- | plugins/check_swap.d/swap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/check_swap.d/swap.c b/plugins/check_swap.d/swap.c index ba8c6439..2fe4544f 100644 --- a/plugins/check_swap.d/swap.c +++ b/plugins/check_swap.d/swap.c | |||
| @@ -69,6 +69,13 @@ swap_result getSwapFromProcMeminfo(char proc_meminfo[]) { | |||
| 69 | swap_result result = {0}; | 69 | swap_result result = {0}; |
| 70 | result.errorcode = STATE_UNKNOWN; | 70 | result.errorcode = STATE_UNKNOWN; |
| 71 | 71 | ||
| 72 | if (meminfo_file_ptr == NULL) { | ||
| 73 | // failed to open meminfo file | ||
| 74 | // errno should contain an error | ||
| 75 | result.errorcode = STATE_UNKNOWN; | ||
| 76 | return result; | ||
| 77 | } | ||
| 78 | |||
| 72 | uint64_t swap_total = 0; | 79 | uint64_t swap_total = 0; |
| 73 | uint64_t swap_used = 0; | 80 | uint64_t swap_used = 0; |
| 74 | uint64_t swap_free = 0; | 81 | uint64_t swap_free = 0; |
