[PATCH] Replace depricated readdir_r with readdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From 33f101a65108931e9d8d9a28adc36884dd4e9ef4 Mon Sep 17 00:00:00 2001
From: Dmitry Shmidt <dimitrysh@xxxxxxxxxx>
Date: Tue, 4 Feb 2020 10:22:31 -0800
Subject: [PATCH] Replace depricated readdir_r with readdir

Signed-off-by: Dmitry Shmidt <dimitrysh@xxxxxxxxxx>
---
 src/common/wpa_ctrl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index c9890a0e4..40a979531 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -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);
--
2.25.0.341.g760bfbb309-goog


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux