diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-28 20:51:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-28 20:55:04 +0100 |
commit | fed1e721fd0c81e60c77120539f34e16c2585634 (patch) | |
tree | a0bb21b49530bc896dcd2c540a582e324c6d7785 /src/test | |
parent | 36afca67b67984520c5c9a6ce14af51a68c7c8cf (diff) |
treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-cgroup-util.c | 2 | ||||
-rw-r--r-- | src/test/test-conf-files.c | 2 | ||||
-rw-r--r-- | src/test/test-uid-range.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c index 68c526ae82..58eb744277 100644 --- a/src/test/test-cgroup-util.c +++ b/src/test/test-cgroup-util.c @@ -141,7 +141,7 @@ static void test_proc(void) { FOREACH_DIRENT(de, d, break) { _cleanup_free_ char *path = NULL, *path_shifted = NULL, *session = NULL, *unit = NULL, *user_unit = NULL, *machine = NULL, *slice = NULL; pid_t pid; - uid_t uid = (uid_t) -1; + uid_t uid = UID_INVALID; if (de->d_type != DT_DIR && de->d_type != DT_UNKNOWN) diff --git a/src/test/test-conf-files.c b/src/test/test-conf-files.c index e801c5989e..945ada59a3 100644 --- a/src/test/test-conf-files.c +++ b/src/test/test-conf-files.c @@ -36,7 +36,7 @@ static void setup_test_dir(char *tmp_dir, const char *files, ...) { va_start(ap, files); while (files != NULL) { _cleanup_free_ char *path = strappend(tmp_dir, files); - assert_se(touch_file(path, true, (usec_t) -1, (uid_t) -1, (gid_t) -1, 0) == 0); + assert_se(touch_file(path, true, (usec_t) -1, UID_INVALID, GID_INVALID, 0) == 0); files = va_arg(ap, const char *); } va_end(ap); diff --git a/src/test/test-uid-range.c b/src/test/test-uid-range.c index 06b4d43426..bc5baa2fcb 100644 --- a/src/test/test-uid-range.c +++ b/src/test/test-uid-range.c @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { assert_se(uid_range_contains(p, n, 999)); assert_se(!uid_range_contains(p, n, 1000)); - search = (uid_t) -1; + search = UID_INVALID; assert_se(uid_range_next_lower(p, n, &search)); assert_se(search == 999); assert_se(uid_range_next_lower(p, n, &search)); |