#254 √ resolved
Justin Bradford

[PATCH] initialization of IO should check for a bad file descriptor

Reported by Justin Bradford | January 15th, 2008 @ 08:02 PM | in 1.0 preview

Initializing IO with a file descriptor now does a check to make sure it's valid, causing a SystemCallError exception otherwise.

This fixes a failure in dir/open_spec, as well.

Comments and changes to this ticket

  • Justin Bradford

    Justin Bradford January 15th, 2008 @ 08:32 PM

    However, this fails for Dir based objects -- we need some other way to check the validity of a file descriptor. Perhaps a fstat?

  • Eero Saynatkari

    Eero Saynatkari January 15th, 2008 @ 08:42 PM

    • → State changed from “new” to “open”
    • → Assigned user changed from “” to “Eero Saynatkari”

    Will commit as soon as I have the chance to review and test if no-one gets to it.

  • Justin Bradford

    Justin Bradford January 15th, 2008 @ 09:57 PM

    The current patch works correctly for files, but fails for directories. The patch in its current form should not be committed, but we do need a more robust method of checking validity of descriptors. I think we might need a new primitive. A fstat call should work for both, but I haven't tested it yet.

  • Brian Ford

    Brian Ford January 20th, 2008 @ 12:50 PM

    • → Title changed from “initialization of IO should check for a bad file descriptor” to “[PATCH] initialization of IO should check for a bad file descriptor”
  • Eero Saynatkari

    Eero Saynatkari January 30th, 2008 @ 06:08 PM

    • → State changed from “open” to “resolved”

    fcntl() based fix for this committed as ed99ebe2. Thanks for pointing this out!

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments

Tags