Module: xenomai-3
Branch: next
Commit: 215ae29a5fb19511e1dcd6aa888984b2726e7401
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=215ae29a5fb19511e1dcd6aa888984b2726e7401

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Mar 25 12:01:05 2015 +0100

demo/altency: set default affinity to CPU0

---

 demo/alchemy/altency.c |   20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/demo/alchemy/altency.c b/demo/alchemy/altency.c
index 8db2280..5365ab2 100644
--- a/demo/alchemy/altency.c
+++ b/demo/alchemy/altency.c
@@ -493,7 +493,7 @@ static void sigdebug(int sig, siginfo_t *si, void *context)
 int main(int argc, char *const *argv)
 {
        struct sigaction sa __attribute__((unused));
-       int c, ret, sig, cpu = -1;
+       int c, ret, sig, cpu = 0;
        char task_name[32];
        cpu_set_t cpus;
        sigset_t mask;
@@ -667,16 +667,14 @@ int main(int argc, char *const *argv)
                        return 0;
                }
 
-               if (cpu >= 0) {
-                       CPU_ZERO(&cpus);
-                       CPU_SET(cpu, &cpus);
-                       ret = rt_task_set_affinity(&latency_task, &cpus);
-                       if (ret) {
-                               fprintf(stderr,
-                                       "altency: failed to set CPU affinity, 
code %d\n",
-                                       ret);
-                               return 0;
-                       }
+               CPU_ZERO(&cpus);
+               CPU_SET(cpu, &cpus);
+               ret = rt_task_set_affinity(&latency_task, &cpus);
+               if (ret) {
+                       fprintf(stderr,
+                               "altency: failed to set CPU affinity, code 
%d\n",
+                               ret);
+                       return 0;
                }
 
                ret = rt_task_start(&latency_task, latency, NULL);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to