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:
parent
fe520b5cdc
commit
6cd3ed9e7e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue