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