summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-28 20:51:01 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-28 20:55:04 +0100
commitfed1e721fd0c81e60c77120539f34e16c2585634 (patch)
treea0bb21b49530bc896dcd2c540a582e324c6d7785 /src/core
parent36afca67b67984520c5c9a6ce14af51a68c7c8cf (diff)
treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1
Diffstat (limited to 'src/core')
-rw-r--r--src/core/execute.c6
-rw-r--r--src/core/socket.c4
-rw-r--r--src/core/timer.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index c19f613641..ea745aa198 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1241,8 +1241,8 @@ static int exec_child(ExecCommand *command,
const char *username = NULL, *home = NULL, *shell = NULL;
unsigned n_dont_close = 0;
int dont_close[n_fds + 4];
- uid_t uid = (uid_t) -1;
- gid_t gid = (gid_t) -1;
+ uid_t uid = UID_INVALID;
+ gid_t gid = GID_INVALID;
int i, err;
assert(command);
@@ -1436,7 +1436,7 @@ static int exec_child(ExecCommand *command,
#ifdef ENABLE_KDBUS
if (params->bus_endpoint_fd >= 0 && context->bus_endpoint) {
- uid_t ep_uid = (uid == (uid_t) -1) ? 0 : uid;
+ uid_t ep_uid = (uid == UID_INVALID) ? 0 : uid;
err = bus_kernel_set_endpoint_policy(params->bus_endpoint_fd, ep_uid, context->bus_endpoint);
if (err < 0) {
diff --git a/src/core/socket.c b/src/core/socket.c
index 828ed31077..8fa55e0b03 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1456,8 +1456,8 @@ static int socket_chown(Socket *s, pid_t *_pid) {
if (pid == 0) {
SocketPort *p;
- uid_t uid = (uid_t) -1;
- gid_t gid = (gid_t) -1;
+ uid_t uid = UID_INVALID;
+ gid_t gid = GID_INVALID;
int ret;
default_signals(SIGNALS_CRASH_HANDLER, SIGNALS_IGNORE, -1);
diff --git a/src/core/timer.c b/src/core/timer.c
index fa134b13ad..70aeedd3c7 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -505,7 +505,7 @@ static void timer_enter_running(Timer *t) {
dual_timestamp_get(&t->last_trigger);
if (t->stamp_path)
- touch_file(t->stamp_path, true, t->last_trigger.realtime, (uid_t) -1, (gid_t) -1, 0);
+ touch_file(t->stamp_path, true, t->last_trigger.realtime, UID_INVALID, GID_INVALID, 0);
timer_set_state(t, TIMER_RUNNING);
return;
@@ -543,7 +543,7 @@ static int timer_start(Unit *u) {
/* The timer has never run before,
* make sure a stamp file exists.
*/
- touch_file(t->stamp_path, true, (usec_t) -1, (uid_t) -1, (gid_t) -1, 0);
+ touch_file(t->stamp_path, true, (usec_t) -1, UID_INVALID, GID_INVALID, 0);
}
t->result = TIMER_SUCCESS;