summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-03-05 05:46:50 -0500
committerEric S. Raymond <esr@thyrsus.com>2012-03-05 05:46:50 -0500
commitd839a54bcd46ed3f664f9fd4113bd1861ad63b78 (patch)
treed97fd794c092276beb479309ff80bb1307bc6cba /gpsd.c
parent8bafe65e56874b3ba7dfdb50874fb0b0a26624a1 (diff)
downloadgpsd-d839a54bcd46ed3f664f9fd4113bd1861ad63b78.tar.gz
Avoid a spurious error message wen running as non-root.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gpsd.c b/gpsd.c
index d97b227a..d8f229b8 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -2077,23 +2077,23 @@ int main(int argc, char *argv[])
if (pw)
(void)setuid(pw->pw_uid);
/*@+type@*/
- }
- gpsd_report(LOG_INF, "running with effective group ID %d\n", getegid());
- gpsd_report(LOG_INF, "running with effective user ID %d\n", geteuid());
-#if defined(HAVE_LIBCAP) && !defined(S_SPLINT_S)
- /* drop root capabilities, except CAP_SYS_TIME for 1PPS support */
- {
- cap_t caps = cap_from_text("cap_sys_time=pe");
+ #if defined(HAVE_LIBCAP) && !defined(S_SPLINT_S)
+ /* drop root capabilities, except CAP_SYS_TIME for 1PPS support */
+ {
+ cap_t caps = cap_from_text("cap_sys_time=pe");
- if (!caps)
- gpsd_report(LOG_ERR, "cap_from_text() failed.\n");
- else if (cap_set_proc(caps) == -1) {
- gpsd_report(LOG_ERR, "cap_set_proc() failed to drop root privs\n");
- cap_free(caps);
+ if (!caps)
+ gpsd_report(LOG_ERR, "cap_from_text() failed.\n");
+ else if (cap_set_proc(caps) == -1) {
+ gpsd_report(LOG_ERR, "cap_set_proc() failed to drop root privs\n");
+ cap_free(caps);
+ }
}
- }
#endif /* HAVE_LIBCAP */
+ }
+ gpsd_report(LOG_INF, "running with effective group ID %d\n", getegid());
+ gpsd_report(LOG_INF, "running with effective user ID %d\n", geteuid());
#ifdef SOCKET_EXPORT_ENABLE
for (i = 0; i < NITEMS(subscribers); i++)