diff options
author | David Sterba <dsterba@suse.com> | 2016-07-26 19:11:42 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-26 19:27:41 +0200 |
commit | 6cd3ed9e7e351ddda4017b273da1b900f7ed1e34 (patch) | |
tree | c561993c540cd13fc1a067e06f5b97d35dc80e61 /cmds-balance.c | |
parent | fe520b5cdc46bc7f34d55b16292d5be805ffd339 (diff) |
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>
Diffstat (limited to 'cmds-balance.c')
-rw-r--r-- | cmds-balance.c | 7 |
1 files changed, 6 insertions, 1 deletions
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); |