--- a/UnixOperatingSystem.st Mon Mar 18 22:12:08 2013 +0000
+++ b/UnixOperatingSystem.st Fri Mar 22 09:18:54 2013 +0000
@@ -10015,10 +10015,12 @@
!UnixOperatingSystem::FileDescriptorHandle class methodsFor:'initialization'!
initialize
- OpenFiles := WeakArray new:10.
- OpenFiles addDependent:self.
-
- "self initialize"
+ OpenFiles := WeakArray new:10.
+ OpenFiles addDependent:self.
+
+ "
+ self initialize
+ "
"Created: 26.9.1997 / 17:15:50 / stefan"
"Modified: 30.9.1997 / 12:40:55 / stefan"
@@ -10072,9 +10074,10 @@
|oldHandle|
fd := aFileDescriptor.
+
"JV@2013-03-15: It may happen that OS returns a filedescriptor whose value
is larger than twice the lenght of the weakarray. Care for this.
- Spotted by Martin Kobetic."
+ Spotted by Martin Kobetic."
oldHandle := OpenFiles at:aFileDescriptor ifAbsent: [nil].
"/ the 0 is possible, if an fd was open when saving a snapshot image,
"/ and we come up in the new image with no one referring to it.
@@ -10083,11 +10086,12 @@
].
self register.
- "Created: / 26-09-1997 / 17:14:40 / stefan"
- "Modified: / 30-09-1997 / 12:41:43 / stefan"
+ "Created: 26.9.1997 / 17:14:40 / stefan"
+ "Modified: 30.9.1997 / 12:41:43 / stefan"
"Modified (comment): / 16-03-2013 / 00:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
+
!UnixOperatingSystem::FileDescriptorHandle methodsFor:'input/output'!
readBytes:count into:aByteBuffer startingAt:firstIndex
@@ -10674,10 +10678,11 @@
fd > sz ifTrue:[
"grow for more descriptors"
old := OpenFiles.
+
"JV@2013-03-15: It may happen that OS returns a filedescriptor whose value
is larger than twice the lenght of the weakarray. Care for this.
Spotted by Martin Kobetic."
- OpenFiles := WeakArray new:((sz * 2) max: fd).
+ OpenFiles := WeakArray new:((sz * 2) max:fd).
old removeDependent:(self class).
OpenFiles addDependent:(self class).
old keysAndValuesDo:[:index :elem|
@@ -10689,7 +10694,8 @@
].
OpenFiles at:fd put:self.
- "Created: / 30-09-1997 / 12:51:48 / stefan"
+ "Created: 30.9.1997 / 12:51:48 / stefan"
+ "Modified: 30.9.1997 / 12:58:37 / stefan"
"Modified (comment): / 16-03-2013 / 00:04:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
@@ -13244,11 +13250,11 @@
!UnixOperatingSystem class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.306 2013-03-08 09:25:33 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.307 2013-03-19 12:59:14 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.306 2013-03-08 09:25:33 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.307 2013-03-19 12:59:14 stefan Exp $'
!
version_HG