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

Do not explicitly call strerror(errnum) when logging #782

Closed
mykaul opened this issue Dec 24, 2019 · 2 comments · Fixed by #2168
Closed

Do not explicitly call strerror(errnum) when logging #782

mykaul opened this issue Dec 24, 2019 · 2 comments · Fixed by #2168
Assignees
Labels
assigned This bug has at least one 'assignee'. It will not get 'stale' label.

Comments

@mykaul
Copy link
Contributor

mykaul commented Dec 24, 2019

For example, instead of:

        gf_msg_debug(this->name, 0, "unlink of %s on %s failed (%s)",
                     local->loc2.path, prev->name, strerror(op_errno));

Use:

        gf_msg_debug(this->name, op_errno, "unlink of %s on %s failed",
                     local->loc2.path, prev->name);

As I believe, that errno is propagated all the way in the logging to finally become the footer:

    /* generate footer */
    if (errnum) {
        ret = gf_asprintf(&footer, " [%s]\n", strerror(errnum));
@stale
Copy link

stale bot commented Jul 21, 2020

Thank you for your contributions.
Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity.
It will be closed in 2 weeks if no one responds with a comment here.

@stale stale bot added the wontfix Managed by stale[bot] label Jul 21, 2020
@mykaul
Copy link
Contributor Author

mykaul commented Jul 22, 2020

unstale please

@stale stale bot removed the wontfix Managed by stale[bot] label Jul 22, 2020
@rkothiya rkothiya self-assigned this Feb 16, 2021
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 16, 2021
As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: gluster#782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 16, 2021
As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: gluster#782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 17, 2021
As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: gluster#782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 17, 2021
As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: gluster#782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 18, 2021
As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: gluster#782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 18, 2021
As per review comments removed trailing spaces and
joined some strings.

Fixes: gluster#782

Change-Id: Ibe406830c9bde9ffd85d48749f43c755ef54ac8e
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 18, 2021
As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: gluster#782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 18, 2021
As per review comments removed trailing spaces and
joined some strings.

Fixes: gluster#782

Change-Id: Ibe406830c9bde9ffd85d48749f43c755ef54ac8e
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 18, 2021
As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: gluster#782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
rkothiya pushed a commit to rkothiya/glusterfs that referenced this issue Feb 18, 2021
As per review comments removed trailing spaces and
joined some strings.

Fixes: gluster#782

Change-Id: Ibe406830c9bde9ffd85d48749f43c755ef54ac8e
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
@amarts amarts added the assigned This bug has at least one 'assignee'. It will not get 'stale' label. label May 28, 2021
rkothiya pushed a commit that referenced this issue Jun 17, 2021
* logging: Avoiding a call to strerror while logging

As strerror is already printed if there is an errnum
avoiding a redundant call to it while logging.

Fixes: #782

Change-Id: I1cde45342e439f821e2d19ca8d90e54906f7a5b2
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>

* logging: Avoiding a call to strerror while logging

As per review comments removed trailing spaces and
joined some strings.

Fixes: #782

Change-Id: Ibe406830c9bde9ffd85d48749f43c755ef54ac8e
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned This bug has at least one 'assignee'. It will not get 'stale' label.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants