]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - sched.c
sched: Mark global now pointer as const.
[paraslash.git] / sched.c
diff --git a/sched.c b/sched.c
index f355c9750bc3ee2c426b2b5505073813973ce3cb..44062a66196c814a19b827f31a40cdec89fb4f37 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -49,7 +49,7 @@ struct task {
 };
 
 static struct timeval now_struct;
 };
 
 static struct timeval now_struct;
-struct timeval *now = &now_struct;
+const struct timeval *now = &now_struct;
 
 static inline bool timeout_is_zero(struct sched *s)
 {
 
 static inline bool timeout_is_zero(struct sched *s)
 {
@@ -147,7 +147,7 @@ again:
        FD_ZERO(&s->wfds);
        s->select_timeout = s->default_timeout;
        s->max_fileno = -1;
        FD_ZERO(&s->wfds);
        s->select_timeout = s->default_timeout;
        s->max_fileno = -1;
-       clock_get_realtime(now);
+       clock_get_realtime(&now_struct);
        sched_preselect(s);
        ret = s->select_function(s->max_fileno + 1, &s->rfds, &s->wfds,
                &s->select_timeout);
        sched_preselect(s);
        ret = s->select_function(s->max_fileno + 1, &s->rfds, &s->wfds,
                &s->select_timeout);
@@ -163,7 +163,7 @@ again:
                FD_ZERO(&s->rfds);
                FD_ZERO(&s->wfds);
        }
                FD_ZERO(&s->rfds);
                FD_ZERO(&s->wfds);
        }
-       clock_get_realtime(now);
+       clock_get_realtime(&now_struct);
        num_running_tasks = sched_post_select(s);
        if (num_running_tasks == 0)
                return 0;
        num_running_tasks = sched_post_select(s);
        if (num_running_tasks == 0)
                return 0;