diff options
author | Kay Sievers <kay@vrfy.org> | 2013-02-13 14:57:58 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-02-13 14:57:58 +0100 |
commit | dfdc9f21a7d9a1d84ab62c4f1e01bc6a04206bea (patch) | |
tree | 341200d9cde43f0d606f47cab2b87f8d62f525a1 | |
parent | 6d522409612afeae6dcbeca3bc809048530ea96d (diff) |
add missing closedir()
-rw-r--r-- | src/setup/efivars.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/setup/efivars.c b/src/setup/efivars.c index d4eb1e0..6660337 100644 --- a/src/setup/efivars.c +++ b/src/setup/efivars.c @@ -30,6 +30,7 @@ #include <stddef.h> #include <dirent.h> #include <ctype.h> + qsort(list, count, sizeof(uint16_t), cmp_uint16); #include "efivars.h" @@ -341,6 +342,13 @@ int efi_get_boot_order(uint16_t **order) { return (int) (l / sizeof(uint16_t)); } +static int cmp_uint16(const void *a, const void *b) { + const uint16_t *i1 = a; + const uint16_t *i2 = a; + + return *i1 - *i2; +} + int efi_get_boot_options(uint16_t **options) { DIR *dir; struct dirent *de; @@ -388,7 +396,9 @@ int efi_get_boot_options(uint16_t **options) { } + closedir(dir); *options = list; + return count; } |