Now that all clients have been adjusted, ensure that no future
misuse of readdir is introduced into the code base.
* cfg.mk (sc_prohibit_readdir): New rule.
* src/util/virfile.c (virDirRead): Exempt the wrapper.
Signed-off-by: Eric Blake <eblake@redhat.com>
halt='use virGetHostname, not gethostname' \
$(_sc_search_regexp)
+sc_prohibit_readdir:
+ @prohibit='\breaddir *\(' \
+ exclude='exempt from syntax-check' \
+ halt='use virDirRead, not readdir' \
+ $(_sc_search_regexp)
+
sc_prohibit_gettext_noop:
@prohibit='gettext_noop *\(' \
halt='use N_, not gettext_noop' \
int virDirRead(DIR *dirp, struct dirent **ent, const char *name)
{
errno = 0;
- *ent = readdir(dirp);
+ *ent = readdir(dirp); /* exempt from syntax-check */
if (!*ent && errno) {
if (name)
virReportSystemError(errno, _("Unable to read directory '%s'"),