-
Notifications
You must be signed in to change notification settings - Fork 38
Add errno details to journal traces #107
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,14 +128,14 @@ static void kernel_fsi_scan_devices(void) | |
|
|
||
| fd = open(path, O_WRONLY | O_SYNC); | ||
| if (fd < 0) { | ||
| PR_ERROR("Unable to open %s\n", path); | ||
| PR_ERROR("Unable to open %s errno: %d\n", path, errno); | ||
| free(path); | ||
| return; | ||
| } | ||
|
|
||
| rc = write(fd, &one, sizeof(one)); | ||
| if (rc < 0) | ||
| PR_ERROR("Unable to write to %s\n", path); | ||
| PR_ERROR("Unable to write to %s errno: %d\n", path, errno); | ||
|
|
||
| free(path); | ||
| close(fd); | ||
|
|
@@ -186,7 +186,7 @@ int kernel_fsi_probe(struct pdbg_target *target) | |
| } | ||
| } | ||
|
|
||
| PR_INFO("Unable to open %s\n", path); | ||
| PR_INFO("Unable to open %s, errno: %d \n", path, errno); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is far away from open failure and error prone. Always better to have it close to failure or save the errno. |
||
| free(path); | ||
| return -1; | ||
| } | ||
|
|
@@ -264,7 +264,7 @@ static int kernel_pib_probe(struct pdbg_target *target) | |
|
|
||
| pib->fd = open(scom_path, O_RDWR | O_SYNC); | ||
| if (pib->fd < 0) { | ||
| PR_INFO("Unable to open %s\n", scom_path); | ||
| PR_INFO("Unable to open %s errno: %d\n", scom_path, errno); | ||
| return -1; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -854,7 +854,7 @@ static int sbefifo_probe(struct pdbg_target *target) | |
|
|
||
| rc = sbefifo_connect(sbefifo_path, proc, &sf->sf_ctx); | ||
| if (rc) { | ||
| PR_ERROR("Unable to open sbefifo driver %s\n", sbefifo_path); | ||
| PR_ERROR("Unable to open sbefifo driver %s errno: %d\n", sbefifo_path, rc); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want to print rc here as we don't know when errno was set in the sbefifo_connect(), right? |
||
| return rc; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After free() errno may have changed. It might be better to check before free() or save the errno.