From: Michal Privoznik Date: Wed, 14 Jul 2021 14:54:54 +0000 (+0200) Subject: virfile: Update example use of virDirRead() X-Git-Tag: v7.6.0-rc1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfca8891226c306cc3a5bacafcef7b5063dcaecf;p=thirdparty%2Flibvirt.git virfile: Update example use of virDirRead() We have an example in virDirRead() documentation on how to use the function. In there, the directory structure is plain DIR, but that won't work anymore. Switch over to g_autoptr(DIR) which is what we use now. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- diff --git a/src/util/virfile.c b/src/util/virfile.c index 4f98b011be..723e1ca6e5 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -2889,9 +2889,9 @@ virDirOpenQuiet(DIR **dirp, const char *name) * @name: if non-NULL, the name related to @dirp for use in error reporting * * Wrapper around readdir. Typical usage: + * g_autoptr(DIR) dir = NULL; * struct dirent *ent; * int rc; - * DIR *dir; * if (virDirOpen(&dir, name) < 0) * goto error; * while ((rc = virDirRead(dir, &ent, name)) > 0)