summaryrefslogtreecommitdiffstats
path: root/lib/csv.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-06-29 13:43:16 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-06-29 21:27:49 +0200
commit0e2d70760d8422e38dd4d6f8ceed2b960b0ed433 (patch)
tree4a4a7dfb21d429485b7245bc6a869b6c83bef152 /lib/csv.c
parentbgpd: Avoid using assignments within checks (diff)
downloadfrr-0e2d70760d8422e38dd4d6f8ceed2b960b0ed433.tar.xz
frr-0e2d70760d8422e38dd4d6f8ceed2b960b0ed433.zip
lib: Avoid using assignments within checks
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'lib/csv.c')
-rw-r--r--lib/csv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/csv.c b/lib/csv.c
index b48b79792..05b9dbe39 100644
--- a/lib/csv.c
+++ b/lib/csv.c
@@ -641,7 +641,8 @@ static int get_memory_usage(pid_t pid)
char *vm;
snprintf(status_child, sizeof(status_child), "/proc/%d/status", pid);
- if ((fd = open(status_child, O_RDONLY)) < 0)
+ fd = open(status_child, O_RDONLY);
+ if (fd < 0)
return -1;
read(fd, buf, 4095);