X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=libatalk%2Fadouble%2Fad_write.c;h=1331ae047d7e33c19a485b28fd347cc5735037f3;hp=d7bb789a8b23c1531168d9e794de107d829358eb;hb=96afda34736f3aee95560c125e59211ab811e203;hpb=56ef10db116a731b4cffdc41ceae813f25b2208a diff --git a/libatalk/adouble/ad_write.c b/libatalk/adouble/ad_write.c index d7bb789a..1331ae04 100644 --- a/libatalk/adouble/ad_write.c +++ b/libatalk/adouble/ad_write.c @@ -1,5 +1,5 @@ /* - * $Id: ad_write.c,v 1.8 2005-04-28 20:49:52 bfernhomberg Exp $ + * $Id: ad_write.c,v 1.9 2006-09-29 09:39:16 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -60,23 +60,23 @@ ssize_t ad_write( ad, eid, off, end, buf, buflen ) if ( eid == ADEID_DFORK ) { if ( end ) { - if ( fstat( ad->ad_df.adf_fd, &st ) < 0 ) { + if ( fstat( ad_data_fileno(ad), &st ) < 0 ) { return( -1 ); } off = st.st_size - off; } - cc = adf_pwrite(&ad->ad_df, buf, buflen, off); + cc = adf_pwrite(&ad->ad_data_fork, buf, buflen, off); } else if ( eid == ADEID_RFORK ) { off_t r_off; if ( end ) { - if ( fstat( ad->ad_df.adf_fd, &st ) < 0 ) { + if ( fstat( ad_data_fileno(ad), &st ) < 0 ) { return( -1 ); } off = st.st_size - off -ad_getentryoff(ad, eid); } r_off = ad_getentryoff(ad, eid) + off; - cc = adf_pwrite(&ad->ad_hf, buf, buflen, r_off); + cc = adf_pwrite(&ad->ad_resource_fork, buf, buflen, r_off); /* sync up our internal buffer FIXME always false? */ if (r_off < ad_getentryoff(ad, ADEID_RFORK)) { @@ -155,7 +155,7 @@ int ad_rtruncate( ad, size ) struct adouble *ad; const off_t size; { - if ( sys_ftruncate( ad->ad_hf.adf_fd, + if ( sys_ftruncate( ad_reso_fileno(ad), size + ad->ad_eid[ ADEID_RFORK ].ade_off ) < 0 ) { return -1; } @@ -168,7 +168,7 @@ int ad_dtruncate(ad, size) struct adouble *ad; const off_t size; { - if (sys_ftruncate(ad->ad_df.adf_fd, size) < 0) { + if (sys_ftruncate(ad_data_fileno(ad), size) < 0) { return -1; } return 0;