From 7d5e9c0f60cddf01ec803012cbdc02d2f55b78c1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 19 Sep 2012 22:21:09 +0200 Subject: 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 --- src/shared/hwclock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/shared/hwclock.c') 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; -- cgit v1.2.3-54-g00ecf