From 073d6862615d4360e23d1fdabc19efbbbda49230 Mon Sep 17 00:00:00 2001 From: Technion Date: Wed, 24 Dec 2014 05:16:45 +0000 Subject: [PATCH] Fix for #17, checks and alerts on permissions. --- time_unix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/time_unix.c b/time_unix.c index 5787b00..c8d7992 100644 --- a/time_unix.c +++ b/time_unix.c @@ -90,6 +90,10 @@ kt_setfreq(double frequency) tx.freq = (long)floor(frequency * (65536 * 1e6)); errno = 0; i = ntp_adjtime(&tx); + if(i == -1 && errno == EPERM) { + Fail(NULL, 0, "Insufficient permissions"); + } + /* XXX: what is the correct error test here ? */ assert(i >= 0); }