ObjFW  Diff

Differences From Artifact [83d1b0c935]:

To Artifact [69833cd0ab]:


157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
157
158
159
160
161
162
163







164
165
166
167
168
169
170







-
-
-
-
-
-
-







	[pool release];
}

@interface OFFileSingleton: OFFile
@end

@implementation OFFile
+ (void)load
{
	of_stdin = [[OFFileSingleton alloc] initWithFileDescriptor: 0];
	of_stdout = [[OFFileSingleton alloc] initWithFileDescriptor: 1];
	of_stderr = [[OFFileSingleton alloc] initWithFileDescriptor: 2];
}

#if defined(OF_THREADS) && !defined(_WIN32)
+ (void)initialize
{
	if (self != [OFFile class])
		return;

	if (!of_mutex_new(&mutex))
784
785
786
787
788
789
790







791
792
793
794
795
796
797
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797







+
+
+
+
+
+
+







		close(fileDescriptor);

	[super dealloc];
}
@end

@implementation OFFileSingleton
+ (void)load
{
	of_stdin = [[OFFileSingleton alloc] initWithFileDescriptor: 0];
	of_stdout = [[OFFileSingleton alloc] initWithFileDescriptor: 1];
	of_stderr = [[OFFileSingleton alloc] initWithFileDescriptor: 2];
}

- initWithPath: (OFString*)path
	  mode: (OFString*)mode
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException exceptionWithClass: c
						    selector: _cmd];