Hi,

given the existing doc of rt_task_suspend about allowed environments and
also when thinking about the logic behind it, I see no reason why
xnpod_unblockable_p() is also applied to task != NULL. This patch
confines the check to task == NULL and also tries to clarify the error
code documentation.

Jan
Index: ksrc/skins/native/task.c
===================================================================
--- ksrc/skins/native/task.c    (revision 1323)
+++ ksrc/skins/native/task.c    (working copy)
@@ -391,9 +391,9 @@ int rt_task_start(RT_TASK *task, void (*
  *
  * - -EINVAL is returned if @a task is not a task descriptor.
  *
- * - -EPERM is returned if @a task is NULL but not called from a task
- * context, or this service was called from a context which cannot
- * sleep (e.g. interrupt, non-realtime or scheduler locked).
+ * - -EPERM is returned if @a task is NULL and this service was called
+ * from a context which cannot sleep (e.g. interrupt, non-realtime or
+ * scheduler locked).
  *
  * - -EIDRM is returned if @a task is a deleted task descriptor.
  *
@@ -430,9 +430,7 @@ int rt_task_suspend(RT_TASK *task)
        if (!task) {
                err = xeno_handle_error(task, XENO_TASK_MAGIC, RT_TASK);
                goto unlock_and_exit;
-       }
-
-       if (xnpod_unblockable_p()) {
+       } else if (xnpod_unblockable_p()) {
                err = -EPERM;
                goto unlock_and_exit;
        }

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to