ObjFW  Diff

Differences From Artifact [222e2d5c1c]:

To Artifact [e66876a272]:


25
26
27
28
29
30
31




32
33
34
35
36
37
38
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42







+
+
+
+







#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif

#ifdef OF_HAVE_SOCKETS
# import "socket_helpers.h"
#endif

#include "platform.h"

#if !defined(OF_WINDOWS) && !defined(OF_MORPHOS)
# include <signal.h>
#endif

1670
1671
1672
1673
1674
1675
1676

1677

1678
1679
1680
1681
1682
1683
1684
1674
1675
1676
1677
1678
1679
1680
1681

1682
1683
1684
1685
1686
1687
1688
1689







+
-
+







{
#if defined(HAVE_FCNTL)
	bool readImplemented = false, writeImplemented = false;

	@try {
		int readFlags;

		readFlags =
		readFlags = fcntl([(id)self fileDescriptorForReading], F_GETFL);
		    fcntl([(id)self fileDescriptorForReading], F_GETFL, 0);

		readImplemented = true;

		if (readFlags == -1)
			@throw [OFSetOptionFailedException
			    exceptionWithObject: self
					  errNo: errno];
1696
1697
1698
1699
1700
1701
1702
1703

1704
1705
1706
1707
1708
1709
1710
1701
1702
1703
1704
1705
1706
1707

1708
1709
1710
1711
1712
1713
1714
1715







-
+







	} @catch (OFNotImplementedException *e) {
	}

	@try {
		int writeFlags;

		writeFlags =
		    fcntl([(id)self fileDescriptorForWriting], F_GETFL);
		    fcntl([(id)self fileDescriptorForWriting], F_GETFL, 0);

		writeImplemented = true;

		if (writeFlags == -1)
			@throw [OFSetOptionFailedException
			    exceptionWithObject: self
					  errNo: errno];