From: Martin Mares Date: Sun, 4 Jun 2000 23:15:58 +0000 (+0000) Subject: Define _GNU_SOURCE, so that pread/pwrite work with glibc 2.1. X-Git-Tag: holmes-import~1633 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=88812076780c42cf75a0245d6126f788081e922c;p=libucw.git Define _GNU_SOURCE, so that pread/pwrite work with glibc 2.1. Don't forget to print out fd's in fatal error messages. --- diff --git a/lib/pagecache.c b/lib/pagecache.c index b51054af..149986d9 100644 --- a/lib/pagecache.c +++ b/lib/pagecache.c @@ -1,9 +1,11 @@ /* * Sherlock Library -- File Page Cache * - * (c) 1999 Martin Mares + * (c) 1999--2000 Martin Mares */ +#define _GNU_SOURCE + #include #include #include @@ -114,7 +116,7 @@ flush_page(struct page_cache *c, struct page *p) if (s < 0) die("pgc_write(%d): %m", p->fd); if (s != (int) c->page_size) - die("pgc_write(%d): incomplete page (only %d of %d)", s, c->page_size); + die("pgc_write(%d): incomplete page (only %d of %d)", p->fd, s, c->page_size); p->flags &= ~PG_FLAG_DIRTY; c->stat_write++; } @@ -291,7 +293,7 @@ pgc_read(struct page_cache *c, int fd, sh_off_t pos) if (s < 0) die("pgc_read(%d): %m", fd); if (s != (int) c->page_size) - die("pgc_read(%d): incomplete page (only %d of %d)", s, c->page_size); + die("pgc_read(%d): incomplete page (only %d of %d)", p->fd, s, c->page_size); p->flags |= PG_FLAG_VALID; } return p;