]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/glob-util: do not use names with "_" prefix
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 5 Mar 2018 08:04:39 +0000 (09:04 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 5 Mar 2018 08:04:39 +0000 (09:04 +0100)
Names starting with _ or __ are reserved by the standard, better to
avoid them.

src/basic/glob-util.c
src/test/test-glob-util.c

index a6ba9ef16344cc15dd8230553ceb760f248781fd..4ac56c91d092fe2275bcef0064635f42a22c5e99 100644 (file)
@@ -29,7 +29,7 @@
 #include "path-util.h"
 #include "strv.h"
 
-static void _closedir(void* v) {
+static void closedir_wrapper(void* v) {
         (void) closedir(v);
 }
 
@@ -40,7 +40,7 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
         assert(!(flags & GLOB_ALTDIRFUNC));
 
         if (!pglob->gl_closedir)
-                pglob->gl_closedir = _closedir;
+                pglob->gl_closedir = closedir_wrapper;
         if (!pglob->gl_readdir)
                 pglob->gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot;
         if (!pglob->gl_opendir)
index ab40a2a4beecee56319f3deabb14fbfd52babd23..a30e04016fea31144089eee0c0bd94e71ffe592d 100644 (file)
@@ -49,7 +49,7 @@ static void test_glob_exists(void) {
         assert_se(r == 0);
 }
 
-static void _closedir(void* v) {
+static void closedir_wrapper(void* v) {
         (void) closedir(v);
 }
 
@@ -58,7 +58,7 @@ static void test_glob_no_dot(void) {
         const char *fn;
 
         _cleanup_globfree_ glob_t g = {
-                .gl_closedir = _closedir,
+                .gl_closedir = closedir_wrapper,
                 .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
                 .gl_opendir = (void *(*)(const char *)) opendir,
                 .gl_lstat = lstat,