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 2022/10/11 09:56:05 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1344: examples: clean warning of pipe

xiaoxiang781216 commented on code in PR #1344:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1344#discussion_r992105881


##########
examples/pipe/interlock_test.c:
##########
@@ -177,21 +194,24 @@ int interlock_test(void)
   ret = pthread_join(writerid, &value);
   if (ret != 0)
     {
-      fprintf(stderr, "interlock_test: pthread_join failed, error=%d\n", ret);
+      fprintf(stderr, \
+        "interlock_test: pthread_join failed, error=%d\n", ret);
       ret = 6;
       goto errout_with_fifo;
     }
   else
     {
-      printf("interlock_test: writer returned %d\n", (int)value);
-      if (value != (void*)0)
+      printf("interlock_test: writer returned %p\n", value);
+      p = (void *) 0;

Review Comment:
   Fixed in https://github.com/apache/incubator-nuttx-apps/pull/1340



##########
examples/pipe/interlock_test.c:
##########
@@ -86,10 +89,12 @@ static void *null_writer(pthread_addr_t pvarg)
     {
       fprintf(stderr, "null_writer: close failed: %d\n", errno);
     }
+
   sleep(5);
 
   printf("null_writer: Returning success\n");
-  return (void*)0;
+  p = (void *) 0;

Review Comment:
   ditto



##########
examples/pipe/interlock_test.c:
##########
@@ -69,9 +70,11 @@ static void *null_writer(pthread_addr_t pvarg)
   fd = open(FIFO_PATH2, O_WRONLY);
   if (fd < 0)
     {
-      fprintf(stderr, "null_writer: Failed to open FIFO %s for writing, errno=%d\n",
+      fprintf(stderr, \
+        "null_writer: Failed to open FIFO %s for writing, errno=%d\n",
               FIFO_PATH2, errno);
-      return (void*)1;
+      p = (void *) 1;

Review Comment:
   ditto



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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