summaryrefslogtreecommitdiff
path: root/os_dep.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-04-22 23:40:15 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:58 +0200
commitd1afd6d5538d21c7ff854563bcedab00d2c0b8ee (patch)
treefa6907e8f93f0f990cf80595793f71875fb6178b /os_dep.c
parent583e58963af8a38848e91d5fab2039e42d6cb911 (diff)
2011-04-22 Ivan Maidanski <ivmai@mail.ru>
* os_dep.c (GC_get_maps): Always close the file. * pthread_support.c (GC_get_nprocs): Ditto. * os_dep.c (READ): Define similarly across the file (without parameters). * pthread_support.c (GC_get_nprocs): Use signed int type for "i" and "len" local variables (since read() may return -1). * include/private/gc_pmark.h (LONG_MULT): Add prefix/suffix double underscore; add "volatile" for asm. * include/private/gc_pmark.h (LONG_MULT): Add missing parentheses. * include/private/gc_priv.h (OR_WORD): Ditto. * include/private/gc_priv.h (OR_WORD): Remove unnecessary brackets and ';' symbol.
Diffstat (limited to 'os_dep.c')
-rw-r--r--os_dep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/os_dep.c b/os_dep.c
index a562b79..db3fd2b 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -264,10 +264,13 @@ GC_INNER char * GC_get_maps(void)
maps_size = 0;
do {
result = GC_repeat_read(f, maps_buf, maps_buf_sz-1);
- if (result <= 0) return 0;
+ if (result <= 0)
+ break;
maps_size += result;
} while (result == maps_buf_sz-1);
close(f);
+ if (result <= 0)
+ return 0;
# ifdef THREADS
if (maps_size > old_maps_size) {
if (GC_print_stats)
@@ -3662,7 +3665,7 @@ GC_INNER void GC_dirty_init(void)
GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
GC_bool is_ptrfree) {}
-# define READ(fd,buf,nbytes) read(fd, buf, nbytes)
+#define READ read
GC_INNER void GC_read_dirty(void)
{