summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/getchark.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/getchark.c')
-rw-r--r--cpukit/libcsupport/src/getchark.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/cpukit/libcsupport/src/getchark.c b/cpukit/libcsupport/src/getchark.c
index 5a9afbda7a..cfe9c022d6 100644
--- a/cpukit/libcsupport/src/getchark.c
+++ b/cpukit/libcsupport/src/getchark.c
@@ -1,8 +1,9 @@
/**
- * @file
+ * @file
*
- * @brief Get Character from Stdin
- * @ingroup libcsupport
+ * @ingroup BSPIO
+ *
+ * @brief This source file contains the implementation of getchark().
*/
/*
@@ -18,13 +19,17 @@
#include "config.h"
#endif
-#include <rtems.h>
#include <rtems/bspIo.h>
-int getchark(void)
+int getchark( void )
{
- if ( BSP_poll_char )
- return (*BSP_poll_char)();
+ BSP_polling_getchar_function_type poll_char;
+
+ poll_char = BSP_poll_char;
+
+ if ( poll_char == NULL ) {
+ return -1;
+ }
- return -1;
+ return ( *poll_char )();
}