mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Prohibit opendir in syntax-check
Prefer virDirOpen.
This commit is contained in:
parent
994b024624
commit
32d0a57812
7
cfg.mk
7
cfg.mk
@ -421,9 +421,9 @@ sc_prohibit_gethostname:
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_prohibit_readdir:
|
||||
@prohibit='\b(read|close)dir *\(' \
|
||||
@prohibit='\b(read|close|open)dir *\(' \
|
||||
exclude='exempt from syntax-check' \
|
||||
halt='use virDirRead and VIR_DIR_CLOSE' \
|
||||
halt='use virDirOpen, virDirRead and VIR_DIR_CLOSE' \
|
||||
$(_sc_search_regexp)
|
||||
|
||||
sc_prohibit_gettext_noop:
|
||||
@ -1265,3 +1265,6 @@ exclude_file_name_regexp--sc_prohibit_dt_without_code = \
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_always-defined_macros = \
|
||||
^tests/virtestmock.c$$
|
||||
|
||||
exclude_file_name_regexp--sc_prohibit_readdir = \
|
||||
^tests/.*mock\.c$$
|
||||
|
@ -2725,7 +2725,7 @@ virFileRemove(const char *path,
|
||||
static int
|
||||
virDirOpenInternal(DIR **dirp, const char *name, bool ignoreENOENT, bool quiet)
|
||||
{
|
||||
*dirp = opendir(name);
|
||||
*dirp = opendir(name); /* exempt from syntax-check */
|
||||
if (!*dirp) {
|
||||
if (quiet)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user