diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 08:33:00 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-10-08 08:33:00 -0600 |
commit | fdb1d0a4df496e7a3232a950d5c72231363cf67a (patch) | |
tree | 5d18c1b4f9241f17396ec663ff4425bf21e6b57a /apps/examples/poll/poll_main.c | |
parent | 1753a0251a941fa4d1a5b95aec631209e9957670 (diff) | |
download | px4-nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.tar.gz px4-nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.tar.bz2 px4-nuttx-fdb1d0a4df496e7a3232a950d5c72231363cf67a.zip |
Remove non-portable references to syslog from apps/examples
Diffstat (limited to 'apps/examples/poll/poll_main.c')
-rw-r--r-- | apps/examples/poll/poll_main.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/apps/examples/poll/poll_main.c b/apps/examples/poll/poll_main.c index 5aa62805f..11479e1a3 100644 --- a/apps/examples/poll/poll_main.c +++ b/apps/examples/poll/poll_main.c @@ -98,20 +98,20 @@ int poll_main(int argc, char *argv[]) /* Open FIFOs */ - message("\npoll_main: Creating FIFO %s\n", FIFO_PATH1); + printf("\npoll_main: Creating FIFO %s\n", FIFO_PATH1); ret = mkfifo(FIFO_PATH1, 0666); if (ret < 0) { - message("poll_main: mkfifo failed: %d\n", errno); + printf("poll_main: mkfifo failed: %d\n", errno); exitcode = 1; goto errout; } - message("\npoll_main: Creating FIFO %s\n", FIFO_PATH2); + printf("\npoll_main: Creating FIFO %s\n", FIFO_PATH2); ret = mkfifo(FIFO_PATH2, 0666); if (ret < 0) { - message("poll_main: mkfifo failed: %d\n", errno); + printf("poll_main: mkfifo failed: %d\n", errno); exitcode = 2; goto errout; } @@ -121,8 +121,8 @@ int poll_main(int argc, char *argv[]) fd1 = open(FIFO_PATH1, O_WRONLY); if (fd1 < 0) { - message("poll_main: Failed to open FIFO %s for writing, errno=%d\n", - FIFO_PATH1, errno); + printf("poll_main: Failed to open FIFO %s for writing, errno=%d\n", + FIFO_PATH1, errno); exitcode = 3; goto errout; } @@ -130,47 +130,47 @@ int poll_main(int argc, char *argv[]) fd2 = open(FIFO_PATH2, O_WRONLY); if (fd2 < 0) { - message("poll_main: Failed to open FIFO %s for writing, errno=%d\n", - FIFO_PATH2, errno); + printf("poll_main: Failed to open FIFO %s for writing, errno=%d\n", + FIFO_PATH2, errno); exitcode = 4; goto errout; } /* Start the listeners */ - message("poll_main: Starting poll_listener thread\n"); + printf("poll_main: Starting poll_listener thread\n"); ret = pthread_create(&tid1, NULL, poll_listener, NULL); if (ret != 0) { - message("poll_main: Failed to create poll_listener thread: %d\n", ret); + printf("poll_main: Failed to create poll_listener thread: %d\n", ret); exitcode = 5; goto errout; } - message("poll_main: Starting select_listener thread\n"); + printf("poll_main: Starting select_listener thread\n"); ret = pthread_create(&tid2, NULL, select_listener, NULL); if (ret != 0) { - message("poll_main: Failed to create select_listener thread: %d\n", ret); + printf("poll_main: Failed to create select_listener thread: %d\n", ret); exitcode = 6; goto errout; } #ifdef HAVE_NETPOLL #ifdef CONFIG_NET_TCPBACKLOG - message("poll_main: Starting net_listener thread\n"); + printf("poll_main: Starting net_listener thread\n"); ret = pthread_create(&tid3, NULL, net_listener, NULL); #else - message("poll_main: Starting net_reader thread\n"); + printf("poll_main: Starting net_reader thread\n"); ret = pthread_create(&tid3, NULL, net_reader, NULL); #endif if (ret != 0) { - message("poll_main: Failed to create net_listener thread: %d\n", ret); + printf("poll_main: Failed to create net_listener thread: %d\n", ret); } #endif @@ -186,7 +186,7 @@ int poll_main(int argc, char *argv[]) nbytes = write(fd1, buffer, strlen(buffer)); if (nbytes < 0) { - message("poll_main: Write to fd1 failed: %d\n", errno); + printf("poll_main: Write to fd1 failed: %d\n", errno); exitcode = 7; goto errout; } @@ -194,13 +194,13 @@ int poll_main(int argc, char *argv[]) nbytes = write(fd2, buffer, strlen(buffer)); if (nbytes < 0) { - message("poll_main: Write fd2 failed: %d\n", errno); + printf("poll_main: Write fd2 failed: %d\n", errno); exitcode = 8; goto errout; } - message("\npoll_main: Sent '%s' (%d bytes)\n", buffer, nbytes); - msgflush(); + printf("\npoll_main: Sent '%s' (%d bytes)\n", buffer, nbytes); + fflush(stdout); /* Wait awhile. This delay should be long enough that the * listener will timeout. |