diff options
author | Julian T <julian@jtle.dk> | 2020-02-15 20:28:59 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-02-15 20:28:59 +0100 |
commit | 8076d839bf69e619f2e504122ec2ceb790a0b978 (patch) | |
tree | fa6cb7c649939c3a002676ce142105360d3d2fd6 /sem3/osc/mm1/mm2/tprog.c | |
parent | f17e8e195bd1ee3f911ae311dce8e8f7df4f8457 (diff) |
Changed to a more consistent codestyle
Diffstat (limited to 'sem3/osc/mm1/mm2/tprog.c')
-rw-r--r-- | sem3/osc/mm1/mm2/tprog.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sem3/osc/mm1/mm2/tprog.c b/sem3/osc/mm1/mm2/tprog.c index 377555f..bb04778 100644 --- a/sem3/osc/mm1/mm2/tprog.c +++ b/sem3/osc/mm1/mm2/tprog.c @@ -10,7 +10,8 @@ struct itimerval timer; -void timer_handler(int signum) { +void timer_handler(int signum) +{ /* Handy structure reference */ struct timeval *tv = &timer.it_value; printf("Hey we hit the alarm\n\a"); @@ -22,9 +23,9 @@ void timer_handler(int signum) { if (tv->tv_usec == 0) { tv->tv_usec = 999999; } else if (tv->tv_usec > ENDUSEC) { - tv->tv_usec *= SPEED; + tv->tv_usec *= SPEED; if (tv->tv_usec < ENDUSEC) { - tv->tv_usec = ENDUSEC; + tv->tv_usec = ENDUSEC; } } else { /* Return letting the timer be set to ENDUSEC */ @@ -36,12 +37,13 @@ void timer_handler(int signum) { /* Set alarm */ int err = setitimer(ITIMER_REAL, &timer, NULL); if (err) { - printf("Hey we got an error guys\n"); - exit(1); + printf("Hey we got an error guys\n"); + exit(1); } } -int main() { +int main() +{ /* Setup handler for timer */ struct sigaction sa; memset(&sa, 0, sizeof(sa)); /* Remeber to set all fields to zero */ |