bugGNUstep - Bugs: bug #9667, [MinGW] GSFileHandle does not...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9667: [MinGW] GSFileHandle does not descriptor associated to socket

Submitted by:  Willem Rein Oudshoorn <wim>
Submitted on:  Fri 16 Jul 2004 02:03:25 PM UTC  
 
Category: Base/FoundationSeverity: 2 - Minor
Item Group: BugStatus: None
Privacy: PublicAssigned to: Willem Rein Oudshoorn <wim>
Open/Closed: Closed

Wed 28 Jul 2004 11:37:38 AM UTC, comment #2:

Commited fix to CVS.

Willem Rein Oudshoorn <wim>
Project MemberIn charge of this item.
Fri 16 Jul 2004 02:04:42 PM UTC, comment #1:

And here is the patch

Willem Rein Oudshoorn <wim>
Project MemberIn charge of this item.
Fri 16 Jul 2004 02:03:25 PM UTC, original submission:

If GSFileHandle is actually a socket the MinGW specific
code for closing the socket is, as far as I can see, not correct.

It does close the socket, but not the C-Runtime file descriptor
created with _open_osfhandle ( )

The fact that this behaviour is wrong can be deomonstrated
with the attached program. This program will repeatedly
create and destroy a GSFileHandle object and after about
2045 iterations it will fail.

I will commit the attached patch if nobody objects.

The patch does the following:

in -[GSFileHandle gcFinalize] and in -[GSFileHandle closeFile]
it will, after calling closesocket also call close on
the filedescriptionr.

Also, in closeFile I changed the check on
"isStandardFile" to using "isSocket", because
it used to decide if we should close a socket.
However I am not sure if this is right, so if there
is a reason that "isStandardFile" is used, please say so.

Wim Oudshoorn

Willem Rein Oudshoorn <wim>
Project MemberIn charge of this item.

 

Attached Files
file #1562:  gsfilehandle.patch added by wim (806B - application/octet-stream - The patch for GSFileHandle.m)
file #1561:  GSFileHandleTest.tar added by wim (10KiB - application/x-tar - Program which demonstrates the problem)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 28 Jul 2004 11:37:38 AM UTCwimAssigned toNone=>wim
  Open/ClosedOpen=>Closed
Fri 16 Jul 2004 02:04:42 PM UTCwimAttached File-=>Added gsfilehandle.patch, #1499
Fri 16 Jul 2004 02:03:25 PM UTCwimAttached File-=>Added GSFileHandleTest.tar, #1498

Back to the top


Powered by Savane 3.1-cleanup1