summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2009-11-11 21:23:54 +0000
committerGary E. Miller <gem@rellim.com>2009-11-11 21:23:54 +0000
commit389409dabb0b6918d3d527fc94b195d478e4483d (patch)
treecad054ccb6d296382f9455b57e4b65bc3901bd8f /gpsd.c
parent2812e996f38991339f871b4063a364b8fb4c067d (diff)
downloadgpsd-389409dabb0b6918d3d527fc94b195d478e4483d.tar.gz
Add a comment so people understand how nice() works...
...and do not make silly changes to it.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gpsd.c b/gpsd.c
index a3bc37ef..66464360 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1918,6 +1918,8 @@ int main(int argc, char *argv[])
#ifdef NTPSHM_ENABLE
if (getuid() == 0) {
errno = 0;
+ // nice() can ONLY succeed when run as root!
+ // do not even bother as non-root
if (nice(NICEVAL) != -1 || errno == 0)
gpsd_report (2, "Priority setting failed.\n");
(void)ntpshm_init(&context, nowait);