diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-19 22:21:09 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-19 22:21:09 +0200 |
commit | 7d5e9c0f60cddf01ec803012cbdc02d2f55b78c1 (patch) | |
tree | ecb5dc336ce9e0ecf6d5e3b6757b0a10f7f1e692 /src/shared/hwclock.c | |
parent | 57f3067825d9361d7487f272bfaff3b36c684c62 (diff) |
util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r().
https://bugzilla.redhat.com/show_bug.cgi?id=858754
Diffstat (limited to 'src/shared/hwclock.c')
-rw-r--r-- | src/shared/hwclock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/hwclock.c b/src/shared/hwclock.c index 67eb2eff8b..b93855d957 100644 --- a/src/shared/hwclock.c +++ b/src/shared/hwclock.c @@ -61,10 +61,11 @@ static int rtc_open(int flags) { for (;;) { char *p, *v; - struct dirent buf, *de; + struct dirent *de; + union dirent_storage buf; int r; - r = readdir_r(d, &buf, &de); + r = readdir_r(d, &buf.de, &de); if (r != 0) goto fallback; |