Saggi Mizrahi has uploaded a new change for review.
Change subject: Properly raise OSError in betterPopen ......................................................................
Properly raise OSError in betterPopen
Change-Id: I2429093229aa1f98263b1d9eb1b5557d49ce52fd Signed-off-by: Saggi Mizrahi smizrahi@redhat.com --- M vdsm/betterPopen/createprocess.c 1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/9592/1
diff --git a/vdsm/betterPopen/createprocess.c b/vdsm/betterPopen/createprocess.c index a57cbae..499bed6 100644 --- a/vdsm/betterPopen/createprocess.c +++ b/vdsm/betterPopen/createprocess.c @@ -289,7 +289,8 @@ safeClose(errnofd[1]); errnofd[1] = -1; if (read(errnofd[0], &childErrno, sizeof(int)) == sizeof(int)) { - PyErr_SetString(PyExc_OSError, strerror(childErrno)); + errno = childErrno; + PyErr_SetFromErrno(PyExc_OSError); goto fail; }
-- To view, visit http://gerrit.ovirt.org/9592 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I2429093229aa1f98263b1d9eb1b5557d49ce52fd Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Saggi Mizrahi smizrahi@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Properly raise OSError in betterPopen ......................................................................
Patch Set 1: Looks good to me, approved
(1 inline comment)
.................................................... File vdsm/betterPopen/createprocess.c Line 288: Line 289: safeClose(errnofd[1]); Line 290: errnofd[1] = -1; Line 291: if (read(errnofd[0], &childErrno, sizeof(int)) == sizeof(int)) { Line 292: errno = childErrno; ok, we own the GIL, so it's not raceful. Line 293: PyErr_SetFromErrno(PyExc_OSError); Line 294: goto fail; Line 295: } Line 296:
-- To view, visit http://gerrit.ovirt.org/9592 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2429093229aa1f98263b1d9eb1b5557d49ce52fd Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com
Saggi Mizrahi has posted comments on this change.
Change subject: Properly raise OSError in betterPopen ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File vdsm/betterPopen/createprocess.c Line 288: Line 289: safeClose(errnofd[1]); Line 290: errnofd[1] = -1; Line 291: if (read(errnofd[0], &childErrno, sizeof(int)) == sizeof(int)) { Line 292: errno = childErrno; It's never raceful, errno is thread local. It would have been impossible to use in a multithreaded environment otherwise Line 293: PyErr_SetFromErrno(PyExc_OSError); Line 294: goto fail; Line 295: } Line 296:
-- To view, visit http://gerrit.ovirt.org/9592 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2429093229aa1f98263b1d9eb1b5557d49ce52fd Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Properly raise OSError in betterPopen ......................................................................
Properly raise OSError in betterPopen
Change-Id: I2429093229aa1f98263b1d9eb1b5557d49ce52fd Signed-off-by: Saggi Mizrahi smizrahi@redhat.com --- M vdsm/betterPopen/createprocess.c 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/9592 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I2429093229aa1f98263b1d9eb1b5557d49ce52fd Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com
Dan Kenigsberg has posted comments on this change.
Change subject: Properly raise OSError in betterPopen ......................................................................
Patch Set 3: Verified; Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/9592 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2429093229aa1f98263b1d9eb1b5557d49ce52fd Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Saggi Mizrahi smizrahi@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Saggi Mizrahi smizrahi@redhat.com
vdsm-patches@lists.fedorahosted.org