Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw/rgw_main: fix unnecessary variables defined #10475

Merged
merged 1 commit into from Aug 8, 2016

Conversation

yonghengdexin735
Copy link
Contributor

Signed-off-by: zhang.zezhu zhang.zezhu@zte.com.cn

derr << "ERROR: " << __func__ << ": write() returned "
<< cpp_strerror(-err) << dendl;
<< cpp_strerror(ret) << dendl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually there is no need ot change the sign &/assign ret here, cpp_strerror already has an internal check for this purpose, so just call cpp_strerror(errno);

Signed-off-by: zhang.zezhu <zhang.zezhu@zte.com.cn>
@yonghengdexin735
Copy link
Contributor Author

@theanalyst I think here defined ret for return and then defined err for 'errno' is unnecessary.
First, the 'errno' assign to ret (ret = errno). socond, remove 'int err = -errno' directly, just call cpp_strerror(errno). here I use the latter.

@yonghengdexin735
Copy link
Contributor Author

@theanalyst done it

@theanalyst
Copy link
Member

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants