From 6cd3ed9e7e351ddda4017b273da1b900f7ed1e34 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 26 Jul 2016 19:11:42 +0200 Subject: [PATCH] btrfs-progs: balance: silence compiler warning cmds-balance.c: In function 'cmd_balance_start': cmds-balance.c:654:6: warning: ignoring return value of 'chdir', declared with attribute warn_unused_result [-Wunused-result] chdir("/"); Reported-by: Satoru Takeuchi Signed-off-by: David Sterba --- cmds-balance.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmds-balance.c b/cmds-balance.c index e9e388e8..c9f1288a 100644 --- a/cmds-balance.c +++ b/cmds-balance.c @@ -646,7 +646,12 @@ static int cmd_balance_start(int argc, char **argv) "unable to fork to run balance in background"); exit(1); case (0): - chdir("/"); + /* + * Read the return value to silence compiler + * warning. Change to / should succeed and + * we're not in a security-sensitive context. + */ + i = chdir("/"); close(0); close(1); close(2);