diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-17 16:55:13 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-17 16:55:13 +0000 |
commit | bcf87589a010480afbe6ab9f1b81cde37c6bdbb5 (patch) | |
tree | 99bfbd591a8a3aa0175b6ea074293e7faaff1a05 /NxWidgets/nxwm/src/cstartwindow.cxx | |
parent | 20958add7b2acc205e71569a3f318196baf7b7cf (diff) | |
download | px4-nuttx-bcf87589a010480afbe6ab9f1b81cde37c6bdbb5.tar.gz px4-nuttx-bcf87589a010480afbe6ab9f1b81cde37c6bdbb5.tar.bz2 px4-nuttx-bcf87589a010480afbe6ab9f1b81cde37c6bdbb5.zip |
Fix a C++ link issue: If constant strings used only in constructor, the don't get linked into the final executable
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4743 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'NxWidgets/nxwm/src/cstartwindow.cxx')
-rw-r--r-- | NxWidgets/nxwm/src/cstartwindow.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/NxWidgets/nxwm/src/cstartwindow.cxx b/NxWidgets/nxwm/src/cstartwindow.cxx index 1c997fbb7..2b7ecbe66 100644 --- a/NxWidgets/nxwm/src/cstartwindow.cxx +++ b/NxWidgets/nxwm/src/cstartwindow.cxx @@ -1,5 +1,5 @@ /******************************************************************************************** - * NxWidgets/nxwm/src/cnxconsole.cxx + * NxWidgets/nxwm/src/cstartwindow.cxx * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> @@ -58,6 +58,16 @@ ********************************************************************************************/ /******************************************************************************************** + * Global Data + ********************************************************************************************/ + +/** + * The well-known name for the Start Window's message queue. + */ + +FAR const char *NxWM::g_startWindowMqName = CONFIG_NXWM_STARTWINDOW_MQNAME; + +/******************************************************************************************** * CStartWindow Method Implementations ********************************************************************************************/ @@ -554,10 +564,10 @@ int CStartWindow::startWindow(int argc, char *argv[]) attr.mq_msgsize = sizeof(struct SStartWindowMessage); attr.mq_flags = 0; - mqd_t mqd = mq_open(CONFIG_NXWM_STARTWINDOW_MQNAME, O_RDONLY|O_CREAT, 0666, &attr); + mqd_t mqd = mq_open(g_startWindowMqName, O_RDONLY|O_CREAT, 0666, &attr); if (mqd == (mqd_t)-1) { - gdbg("ERROR: mq_open(%s) failed: %d\n", CONFIG_NXWM_STARTWINDOW_MQNAME, errno); + gdbg("ERROR: mq_open(%s) failed: %d\n", g_startWindowMqName, errno); return EXIT_FAILURE; } @@ -573,12 +583,14 @@ int CStartWindow::startWindow(int argc, char *argv[]) ssize_t nbytes = mq_receive(mqd, &msg, sizeof(struct SStartWindowMessage), 0); if (nbytes < 0) { + int errval = errno; + // EINTR is not an error. The wait was interrupted by a signal and // we just need to try reading again. - if (errno != EINTR) + if (errval != EINTR) { - gdbg("ERROR: mq_receive failed: %d\n", errno); + gdbg("ERROR: mq_receive failed: %d\n", errval); } } while (nbytes < 0); |