/*
- * $Id: file.c,v 1.92.2.2.2.31.2.15 2005-09-27 10:40:41 didg Exp $
+ * $Id: file.c,v 1.92.2.2.2.31.2.22 2008-11-25 15:16:33 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
}
/* FIXME path : unix or mac name ? (for now it's unix name ) */
-void *get_finderinfo(const char *upath, struct adouble *adp, void *data)
+void *get_finderinfo(const struct vol *vol, const char *upath, struct adouble *adp, void *data)
{
struct extmap *em;
void *ad_finder = NULL;
else {
memcpy(data, ufinderi, ADEDLEN_FINDERI);
chk_ext = 1;
- if (*upath == '.') { /* make it invisible */
+ if (vol_inv_dots(vol) && *upath == '.') { /* make it invisible */
u_int16_t ashort;
ashort = htons(FINDERINFO_INVISIBLE);
- memcpy(data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort));
+ memcpy((char *)data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort));
}
}
/** Only enter if no appledouble information and no finder information found. */
case FILPBIT_ATTR :
if ( adp ) {
ad_getattr(adp, &ashort);
- } else if (*upath == '.') {
+ } else if (vol_inv_dots(vol) && *upath == '.') {
ashort = htons(ATTRBIT_INVISIBLE);
} else
ashort = 0;
break;
case FILPBIT_FINFO :
- get_finderinfo(upath, adp, (char *)data);
+ get_finderinfo(vol, upath, adp, (char *)data);
data += ADEDLEN_FINDERI;
break;
openf = O_RDWR|O_CREAT|O_EXCL;
}
- if ( ad_open( upath, vol_noadouble(vol)|ADFLAGS_DF|ADFLAGS_HF|ADFLAGS_NOHF,
+ if ( ad_open( upath, vol_noadouble(vol)|ADFLAGS_DF|ADFLAGS_HF|ADFLAGS_NOHF|ADFLAGS_CREATE,
openf, 0666, adp) < 0 ) {
switch ( errno ) {
case EROFS:
return( AFPERR_EXIST );
case EACCES :
return( AFPERR_ACCESS );
+ case EDQUOT:
+ case ENOSPC :
+ return( AFPERR_DFULL );
default :
return( AFPERR_PARAM );
}
}
/* ----------------------- */
-static __inline__ int copy_all(const int dfd, const void *buf,
+static int copy_all(const int dfd, const void *buf,
size_t buflen)
{
ssize_t cc;
st.st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH;
}
- if (ad_open(dst , adflags | noadouble, O_RDWR|O_CREAT|O_EXCL, st.st_mode, &add) < 0) {
+ if (ad_open(dst , adflags, O_RDWR|O_CREAT|O_EXCL, st.st_mode, &add) < 0) {
ret_err = errno;
ad_close( adp, adflags );
if (EEXIST != ret_err) {
ad_close( adp, adflags );
if (ad_close( &add, adflags ) <0) {
+ if (!ret_err) {
+ ret_err = errno;
+ }
deletefile(d_vol, dst, 0);
- ret_err = errno;
goto done;
}