Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Pryor <jpryor@novell.com>2008-12-20 06:19:18 +0300
committerJonathan Pryor <jpryor@novell.com>2008-12-20 06:19:18 +0300
commitb0313b64f97dc6839024615db01f49e09660a94c (patch)
treee6f289f3b9fc963047a55881971ed3c8d0780302 /support
parent14f0503b18c20b54f5b93d7a7f6c69793be1af6c (diff)
* signal.c: Improve error checking within Mono_Posix_FromRealTimeSignum.
svn path=/trunk/mono/; revision=121910
Diffstat (limited to 'support')
-rw-r--r--support/ChangeLog4
-rw-r--r--support/signal.c23
2 files changed, 20 insertions, 7 deletions
diff --git a/support/ChangeLog b/support/ChangeLog
index e78587144f2..0b87065493d 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,5 +1,9 @@
2008-12-19 Jonathan Pryor <jpryor@novell.com>
+ * signal.c: Improve error checking within Mono_Posix_FromRealTimeSignum.
+
+2008-12-19 Jonathan Pryor <jpryor@novell.com>
+
* map.h: Flush.
* signal.c: Add Mono_Posix_SIGRTMIN(), Mono_Posix_SIGRTMAX(),
Mono_Posix_FromRealTimeSignum().
diff --git a/support/signal.c b/support/signal.c
index abf11038bb7..28498285457 100644
--- a/support/signal.c
+++ b/support/signal.c
@@ -74,15 +74,24 @@ int Mono_Posix_SIGRTMAX (void)
int Mono_Posix_FromRealTimeSignum (int offset, int *r)
{
- *r = 0;
+ if (NULL == r) {
+ errno = EINVAL;
+ return -1;
+ }
+ *r = 0;
#if defined (SIGRTMIN) && defined (SIGRTMAX)
- if ((offset < 0) || (SIGRTMIN > SIGRTMAX - offset))
+ if ((offset < 0) || (SIGRTMIN > SIGRTMAX - offset)) {
+ errno = EINVAL;
+ return -1;
+ }
+ *r = SIGRTMIN+offset;
+ return 0;
+#else /* defined (SIGRTMIN) && defined (SIGRTMAX) */
+# ifdef ENOSYS
+ errno = ENOSYS;
+# endif /* ENOSYS */
return -1;
- *r = SIGRTMIN+offset;
- return 0;
-#else
- return -1;
-#endif
+#endif /* defined (SIGRTMIN) && defined (SIGRTMAX) */
}
#ifndef PLATFORM_WIN32