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

Group
 
 

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

Submitter:  Willem Rein Oudshoorn <wim>
Submitted:  Fri 16 Jul 2004 02:03:25 PM UTC
   
 
Category:  Base/Foundation Severity:  2 - Minor
Item Group:  Bug Status:  None
Privacy:  Public Assigned to:  wim
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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

Commited fix to CVS.

Willem Rein Oudshoorn <wim>
Group Member
Fri 16 Jul 2004 02:04:42 PM UTC, comment #1: 

And here is the patch

Willem Rein Oudshoorn <wim>
Group Member
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>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-07-28 wim Assigned toNone wim
    Open/ClosedOpen Closed
2004-07-16 wim Attached File- Added gsfilehandle.patch, #1499
2004-07-16 wim Attached File- Added GSFileHandleTest.tar, #1498

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code