-#ifdef USE_MMAPPED_HEADERS
- if (eid != ADEID_RFORK) {
- memcpy(buf, ad->ad_data + cc, buflen);
- cc = buflen;
- goto ad_read_done;
- }
-#endif /* USE_MMAPPED_HEADERS */
- if ( ad->ad_hf.adf_off != cc ) {
- if ( lseek( ad->ad_hf.adf_fd, (off_t) cc, SEEK_SET ) < 0 ) {
- return( -1 );
- }
- ad->ad_hf.adf_off = cc;
- }
-
- if (( cc = read( ad->ad_hf.adf_fd, buf, buflen )) < 0 ) {
- return( -1 );
- }
-
-#ifndef USE_MMAPPED_HEADERS
- /*
- * We've just read in bytes from the disk that we read earlier
- * into ad_data. If we're going to write this buffer out later,
- * we need to update ad_data.
- */
- if (ad->ad_hf.adf_off < ad_getentryoff(ad, ADEID_RFORK)) {
- if ( ad->ad_hf.adf_flags & O_RDWR ) {
- memcpy(buf, ad->ad_data + ad->ad_hf.adf_off,
- MIN(sizeof( ad->ad_data ) - ad->ad_hf.adf_off, cc));
- } else {
- memcpy(ad->ad_data + ad->ad_hf.adf_off, buf,
- MIN(sizeof( ad->ad_data ) - ad->ad_hf.adf_off, cc));
- }
- }
- ad->ad_hf.adf_off += cc;
-#else /* ! USE_MMAPPED_HEADERS */
-ad_read_done:
-#endif /* ! USE_MMAPPED_HEADERS */