aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-08-14 00:06:55 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-08-14 00:06:55 +0300
commitc4300d657ba49db0b6d0f0884f41a29622edc58b (patch)
treea49e5590dab96979293e3c16455d9f305d9ce738 /io.c
parent69b59a73db108ede65e4dfce90fcfb10723e1feb (diff)
parent15a922b8a62092fab8b0e9b9fa06c3182b38b596 (diff)
downloadegawk-c4300d657ba49db0b6d0f0884f41a29622edc58b.tar.gz
egawk-c4300d657ba49db0b6d0f0884f41a29622edc58b.tar.bz2
egawk-c4300d657ba49db0b6d0f0884f41a29622edc58b.zip
Merge branch 'master' into select
Diffstat (limited to 'io.c')
-rw-r--r--io.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/io.c b/io.c
index 01dc7cbe..37ec892c 100644
--- a/io.c
+++ b/io.c
@@ -185,10 +185,6 @@
#define INCREMENT_REC(X) X++
#endif
-/* This is for fake directory file descriptors on systems that don't
- allow to open() a directory. */
-#define FAKE_FD_VALUE 42
-
typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type;
/* Several macros to make the code a bit clearer. */
@@ -3574,12 +3570,12 @@ get_a_record(char **out, /* pointer to pointer to data */
recm.rt_start = iop->off + recm.len;
/* read more data, break if EOF */
-#ifndef min
-#define min(x, y) (x < y ? x : y)
+#ifndef MIN
+#define MIN(x, y) (x < y ? x : y)
#endif
/* subtract one in read count to leave room for sentinel */
room_left = iop->end - iop->dataend - 1;
- amt_to_read = min(iop->readsize, room_left);
+ amt_to_read = MIN(iop->readsize, room_left);
if (amt_to_read < iop->readsize) {
grow_iop_buffer(iop);
@@ -3590,7 +3586,7 @@ get_a_record(char **out, /* pointer to pointer to data */
/* recalculate amt_to_read */
room_left = iop->end - iop->dataend - 1;
- amt_to_read = min(iop->readsize, room_left);
+ amt_to_read = MIN(iop->readsize, room_left);
}
while (amt_to_read + iop->readsize < room_left)
amt_to_read += iop->readsize;
@@ -3600,7 +3596,7 @@ get_a_record(char **out, /* pointer to pointer to data */
* POSIX limits read to SSIZE_MAX. There are (bizarre)
* systems where this amount is small.
*/
- amt_to_read = min(amt_to_read, SSIZE_MAX);
+ amt_to_read = MIN(amt_to_read, SSIZE_MAX);
#endif
iop->count = iop->public.read_func(iop->public.fd, iop->dataend, amt_to_read);