[PATCH 1/5] score: Add rtems_set_errno_and_return_value()
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Mar 9 12:18:32 UTC 2015
---
cpukit/score/include/rtems/seterr.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/cpukit/score/include/rtems/seterr.h b/cpukit/score/include/rtems/seterr.h
index 1e9e0d0..a3a977d 100644
--- a/cpukit/score/include/rtems/seterr.h
+++ b/cpukit/score/include/rtems/seterr.h
@@ -51,6 +51,16 @@
#define rtems_set_errno_and_return_minus_one_cast( _error, _cast ) \
do { errno = (_error); return (_cast) -1; } while(0)
+/**
+ * This is a helper macro which will set the variable errno and return
+ * the specified value to the caller.
+ *
+ * @param[in] _error is the error code
+ * @param[in] _value is the value to return
+ */
+#define rtems_set_errno_and_return_value( _error, _value ) \
+ do { errno = (_error); return (_value); } while(0)
+
/**@}*/
#endif
/* end of include file */
--
1.8.4.5
More information about the devel
mailing list