mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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 <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
1678a34f47
commit
bfca889122
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user