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 2020/07/03 15:07:53 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 opened a new pull request #325: Change all statfs to statvfs

xiaoxiang781216 opened a new pull request #325:
URL: https://github.com/apache/incubator-nuttx-apps/pull/325


   ## Summary
   follow up the kernel side change
   
   ## Impact
   
   ## Testing
   
   


----------------------------------------------------------------
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



[GitHub] [incubator-nuttx-apps] yamt commented on a change in pull request #325: Change all statfs to statvfs

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #325:
URL: https://github.com/apache/incubator-nuttx-apps/pull/325#discussion_r452785786



##########
File path: examples/mount/mount_main.c
##########
@@ -158,40 +158,42 @@ static void show_stat(const char *path, struct stat *ps)
 #endif
 
 /****************************************************************************
- * Name: show_statfs
+ * Name: show_statvfs
  ****************************************************************************/
 
 #ifdef TEST_USE_STATFS
-static void show_statfs(const char *path)
+static void show_statvfs(const char *path)
 {
-  struct statfs buf;
+  struct statvfs buf;
   int ret;
 
-  /* Try stat() against a file or directory.  It should fail with expectederror */
+  /* Try stat() against a file or directory.  It should fail with
+   * expectederror
+   */
 
-  printf("show_statfs: Try statfs(%s)\n", path);
-  ret = statfs(path, &buf);
+  printf("show_statvfs: Try statvfs(%s)\n", path);
+  ret = statvfs(path, &buf);
   if (ret == 0)
     {
-      printf("show_statfs: statfs(%s) succeeded\n", path);
-      printf("\tFS Type           : %0x\n", buf.f_type);
+      printf("show_statvfs: statvfs(%s) succeeded\n", path);
+      printf("\tFS Type           : %0x\n", buf.f_fsid);
       printf("\tBlock size        : %d\n", buf.f_bsize);
       printf("\tNumber of blocks  : %d\n", buf.f_blocks);
       printf("\tFree blocks       : %d\n", buf.f_bfree);
       printf("\tFree user blocks  : %d\n", buf.f_bavail);
       printf("\tNumber file nodes : %d\n", buf.f_files);
       printf("\tFree file nodes   : %d\n", buf.f_ffree);
-      printf("\tFile name length  : %d\n", buf.f_namelen);
+      printf("\tFile name length  : %d\n", buf.f_namemax);

Review comment:
       although not a fault of this patch, many of these printf formats seem wrong.

##########
File path: examples/mount/mount_main.c
##########
@@ -158,40 +158,42 @@ static void show_stat(const char *path, struct stat *ps)
 #endif
 
 /****************************************************************************
- * Name: show_statfs
+ * Name: show_statvfs
  ****************************************************************************/
 
 #ifdef TEST_USE_STATFS
-static void show_statfs(const char *path)
+static void show_statvfs(const char *path)
 {
-  struct statfs buf;
+  struct statvfs buf;
   int ret;
 
-  /* Try stat() against a file or directory.  It should fail with expectederror */
+  /* Try stat() against a file or directory.  It should fail with
+   * expectederror
+   */
 
-  printf("show_statfs: Try statfs(%s)\n", path);
-  ret = statfs(path, &buf);
+  printf("show_statvfs: Try statvfs(%s)\n", path);
+  ret = statvfs(path, &buf);
   if (ret == 0)
     {
-      printf("show_statfs: statfs(%s) succeeded\n", path);
-      printf("\tFS Type           : %0x\n", buf.f_type);
+      printf("show_statvfs: statvfs(%s) succeeded\n", path);
+      printf("\tFS Type           : %0x\n", buf.f_fsid);

Review comment:
       FS ID, not Type.
   also, printf format needs an update for unsigned long.
   

##########
File path: interpreters/ficl/src/nuttx.c
##########
@@ -1,12 +1,58 @@
+/****************************************************************************
+ * apps/interpreters/minibasic/basic.c
+ *
+ *   Copyright (C) 2016 Gregory Nutt. All rights reserved.
+ *
+ * This file was taken from Mini Basic, versino 1.0 developed by Malcolm
+ * McLean, Leeds University.  Mini Basic version 1.0 was released the
+ * Creative Commons Attribution license which, from my reading, appears to
+ * be compatible with the NuttX BSD-style license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/

Review comment:
       does this (copyright notice) belong to this PR?




----------------------------------------------------------------
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



[GitHub] [incubator-nuttx-apps] xiaoxiang781216 closed pull request #325: Change all statfs to statvfs

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 closed pull request #325:
URL: https://github.com/apache/incubator-nuttx-apps/pull/325


   


----------------------------------------------------------------
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