You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/29 06:46:57 UTC

[GitHub] [incubator-nuttx-apps] donghengqaz commented on a change in pull request #637: testing/fstest: Add hash checking of file's name to avoid creating same-name file

donghengqaz commented on a change in pull request #637:
URL: https://github.com/apache/incubator-nuttx-apps/pull/637#discussion_r603047349



##########
File path: testing/fstest/fstest_main.c
##########
@@ -188,6 +189,29 @@ static inline char fstest_randchar(void)
     }
 }
 
+/****************************************************************************
+ * Name: fstest_checkexit
+ ****************************************************************************/
+
+static bool fstest_checkexit(FAR struct fstest_filedesc_s *file)
+{
+  int i;
+  bool ret = false;
+
+  for (i = 0; i < CONFIG_TESTING_FSTEST_MAXOPEN; i++)
+    {
+      if (!g_files[i].deleted &&
+          &g_files[i] != file &&
+          g_files[i].hash == file->hash)

Review comment:
       Using hash just want to speed up process when files and names are a little of more.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org