]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/port/portclock.c
kernel: keep segment locked for data2txt
[plan9front.git] / sys / src / 9 / port / portclock.c
old mode 100755 (executable)
new mode 100644 (file)
index 624283d..3f7d4be
@@ -214,6 +214,8 @@ timersinit(void)
         */
        todinit();
        t = malloc(sizeof(*t));
+       if(t == nil)
+               panic("timersinit: no memory for Timer");
        t->tmode = Tperiodic;
        t->tt = nil;
        t->tns = 1000000000/HZ;
@@ -229,6 +231,8 @@ addclock0link(void (*f)(void), int ms)
 
        /* Synchronize to hztimer if ms is 0 */
        nt = malloc(sizeof(Timer));
+       if(nt == nil)
+               panic("addclock0link: no memory for Timer");
        if(ms == 0)
                ms = 1000/HZ;
        nt->tns = (vlong)ms*1000000LL;