diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-04-24 13:44:09 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | 10380a7990aeed007a771bcf955e203272bfce54 (patch) | |
tree | 87cf675b459c7a22353c6f42f748cbf231ffcb07 /src/core | |
parent | 71c3693c618189fa097eed1113aa1dd86f032cee (diff) |
tree-wide: avoid assignment of r just to use in a comparison
This changes
r = ...;
if (r < 0)
to
if (... < 0)
when r will not be used again.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/cgroup.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 34ff984df..a1e66864b 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -309,13 +309,11 @@ void cgroup_context_dump(CGroupContext *c, FILE* f, const char *prefix) { static int lookup_block_device(const char *p, dev_t *dev) { struct stat st; - int r; assert(p); assert(dev); - r = stat(p, &st); - if (r < 0) + if (stat(p, &st) < 0) return log_warning_errno(errno, "Couldn't stat device %s: %m", p); if (S_ISBLK(st.st_mode)) |