xiaoxiang781216 commented on a change in pull request #709:
URL: 
https://github.com/apache/incubator-nuttx-apps/pull/709#discussion_r629032746



##########
File path: examples/elf/elf_main.c
##########
@@ -364,7 +362,8 @@ int main(int argc, FAR char *argv[])
 
       if (ret < 0)
         {
-          errmsg("ERROR: exec(%s) failed: %d\n", dirlist[i], errno);
+          errmsg("ERROR: exec(%s) failed: %s\n",
+          dirlist[i], strerror(errno));

Review comment:
       ```suggestion
                  dirlist[i], strerror(errno));
   ```

##########
File path: examples/posix_spawn/spawn_main.c
##########
@@ -231,14 +236,14 @@ int main(int argc, FAR char *argv[])
   /* Mount the file system */
 
   message("Mounting ROMFS filesystem at target=%s with source=%s\n",
-         MOUNTPT, CONFIG_EXAMPLES_ELF_DEVPATH);
+         MOUNTPT, CONFIG_EXAMPLES_POSIXSPAWN_DEVPATH);

Review comment:
       ```suggestion
             MOUNTPT, CONFIG_EXAMPLES_POSIXSPAWN_DEVPATH);
   ```

##########
File path: examples/unionfs/unionfs_main.c
##########
@@ -149,18 +156,22 @@ int main(int argc, FAR char *argv[])
               MS_RDONLY, NULL);
   if (ret < 0)
     {
-      printf("ERROR: File system 1 mount failed: %d\n", errno);
+      printf("ERROR: File system 1 mount failed: %s\n", strerror(errno));
       return EXIT_FAILURE;
     }
 
-  /* Create a RAM disk for file system 2 */
+  /* Create a RAM disk for file system 2  */
+
+  desc.minor    = CONFIG_EXAMPLES_UNIONFS_RAMDEVNO_B;      /* Minor device 
number of the ROM disk. */
+  desc.nsectors = NSECTORS(btestdir_img_len);              /* The number of 
sectors in the ROM disk */
+  desc.image    = (FAR uint8_t *)btestdir_img;             /* File system 
image */
+
+  ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc);
 
-  ret = romdisk_register(CONFIG_EXAMPLES_UNIONFS_RAMDEVNO_B, btestdir_img,
-                         NSECTORS(btestdir_img_len),
-                         CONFIG_EXAMPLES_UNIONFS_SECTORSIZE);
   if (ret < 0)
     {
-      printf("ERROR: Failed to register file system 1: %d\n", ret);
+      printf("ERROR: Failed to create file system 2 RAM disk: %s\n",
+            strerror(errno));

Review comment:
       ```suggestion
                strerror(errno));
   ```

##########
File path: examples/unionfs/unionfs_main.c
##########
@@ -128,15 +129,21 @@
 int main(int argc, FAR char *argv[])
 {
   int ret;
+  struct boardioc_romdisk_s desc;
 
   /* Create a RAM disk for file system 1 */
 
-  ret = romdisk_register(CONFIG_EXAMPLES_UNIONFS_RAMDEVNO_A, atestdir_img,
-                         NSECTORS(atestdir_img_len),
-                         CONFIG_EXAMPLES_UNIONFS_SECTORSIZE);
+  desc.minor    = CONFIG_EXAMPLES_UNIONFS_RAMDEVNO_A;       /* Minor device 
number of the ROM disk. */
+  desc.nsectors = NSECTORS(atestdir_img_len);               /* The number of 
sectors in the ROM disk */
+  desc.sectsize = CONFIG_EXAMPLES_UNIONFS_SECTORSIZE;       /* The size of one 
sector in bytes */
+  desc.image    = (FAR uint8_t *)atestdir_img;              /* File system 
image */
+
+  ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc);
+
   if (ret < 0)
     {
-      printf("ERROR: Failed to create file system 1 RAM disk\n");
+      printf("ERROR: Failed to create file system 1 RAM disk: %s\n",
+            strerror(errno));

Review comment:
       ```suggestion
                strerror(errno));
   ```

##########
File path: examples/elf/elf_main.c
##########
@@ -257,7 +254,8 @@ int main(int argc, FAR char *argv[])
   ret = mount(NULL, MOUNTPT, "cromfs", MS_RDONLY, NULL);
   if (ret < 0)
     {
-      errmsg("ERROR: mount(%s, cromfs) failed: %d\n", MOUNTPT, errno);
+      errmsg("ERROR: mount(%s, cromfs) failed: %s\n",
+      MOUNTPT, strerror(errno));

Review comment:
       ```suggestion
                MOUNTPT, strerror(errno));
   ```




-- 
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:
[email protected]


Reply via email to