]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Replace deprecated readdir_r() with readdir()
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 4 Feb 2020 18:27:49 +0000 (18:27 +0000)
committerJouni Malinen <jouni@codeaurora.org>
Mon, 10 Feb 2020 04:40:50 +0000 (06:40 +0200)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
src/common/wpa_ctrl.c

index c9890a0e49050ebd73d21045cba853589033368c..40a979531b53673b4f7dafbc8d55919c8c493a7f 100644 (file)
@@ -266,7 +266,6 @@ void wpa_ctrl_close(struct wpa_ctrl *ctrl)
 void wpa_ctrl_cleanup(void)
 {
        DIR *dir;
-       struct dirent entry;
        struct dirent *result;
        size_t dirnamelen;
        size_t maxcopy;
@@ -284,8 +283,8 @@ void wpa_ctrl_cleanup(void)
        }
        namep = pathname + dirnamelen;
        maxcopy = PATH_MAX - dirnamelen;
-       while (readdir_r(dir, &entry, &result) == 0 && result != NULL) {
-               if (os_strlcpy(namep, entry.d_name, maxcopy) < maxcopy)
+       while ((result = readdir(dir)) != NULL) {
+               if (os_strlcpy(namep, result->d_name, maxcopy) < maxcopy)
                        unlink(pathname);
        }
        closedir(dir);