Patchwork Android: Clean entire socket directory

login
register
mail settings
Submitter Dmitry Shmidt
Date Sept. 5, 2013, 9:52 p.m.
Message ID <20130905215621.64CB614001B@ushik.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/272983/
State Accepted
Headers show

Comments

Dmitry Shmidt - Sept. 5, 2013, 9:52 p.m.
Despite interface (and group) related sockets are not used
for control, they are created and may be left.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
 src/common/wpa_ctrl.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Jouni Malinen - Nov. 22, 2013, 4:30 p.m.
On Thu, Sep 05, 2013 at 02:52:18PM -0700, Dmitry Shmidt wrote:
> Despite interface (and group) related sockets are not used
> for control, they are created and may be left.

Thanks, applied.

Patch

diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index d9a7509..83788d7 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -229,7 +229,6 @@  void wpa_ctrl_cleanup(void)
 	struct dirent entry;
 	struct dirent *result;
 	size_t dirnamelen;
-	int prefixlen = os_strlen(CONFIG_CTRL_IFACE_CLIENT_PREFIX);
 	size_t maxcopy;
 	char pathname[PATH_MAX];
 	char *namep;
@@ -246,11 +245,8 @@  void wpa_ctrl_cleanup(void)
 	namep = pathname + dirnamelen;
 	maxcopy = PATH_MAX - dirnamelen;
 	while (readdir_r(dir, &entry, &result) == 0 && result != NULL) {
-		if (os_strncmp(entry.d_name, CONFIG_CTRL_IFACE_CLIENT_PREFIX,
-			       prefixlen) == 0) {
-			if (os_strlcpy(namep, entry.d_name, maxcopy) < maxcopy)
-				unlink(pathname);
-		}
+		if (os_strlcpy(namep, entry.d_name, maxcopy) < maxcopy)
+			unlink(pathname);
 	}
 	closedir(dir);
 }