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/delta/delta.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/delta') diff --git a/src/delta/delta.c b/src/delta/delta.c index eef6536b01..803d2a7fc7 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -176,11 +176,12 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, const char *path) { } for (;;) { - struct dirent *de, buf; + struct dirent *de; + union dirent_storage buf; int k; char *p; - k = readdir_r(d, &buf, &de); + k = readdir_r(d, &buf.de, &de); if (k != 0) { r = -k; goto finish; -- cgit v1.2.3-54-g00ecf