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 <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-07-26 19:11:42 +02:00
parent fe520b5cdc
commit 6cd3ed9e7e
1 changed files with 6 additions and 1 deletions

View File

@ -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);