offspring book keeping.
/*
- * $Id: directory.c,v 1.48 2002-10-14 06:30:49 didg Exp $
+ * $Id: directory.c,v 1.49 2002-10-25 11:10:46 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
{
struct maccess ma;
struct adouble ad;
- char *data, *nameoff = NULL;
+ char *data, *l_nameoff = NULL, *utf_nameoff = NULL;
int bit = 0, isad = 0;
u_int32_t aint;
u_int16_t ashort;
case DIRPBIT_LNAME :
if (dir->d_m_name) /* root of parent can have a null name */
- nameoff = data;
+ l_nameoff = data;
else
memset(data, 0, sizeof(u_int16_t));
data += sizeof( u_int16_t );
if (afp_version >= 30) { /* UTF8 name */
utf8 = kTextEncodingUTF8;
if (dir->d_m_name) /* root of parent can have a null name */
- nameoff = data;
+ utf_nameoff = data;
else
memset(data, 0, sizeof(u_int16_t));
data += sizeof( u_int16_t );
bitmap = bitmap>>1;
bit++;
}
- if ( nameoff ) {
+ if ( l_nameoff ) {
ashort = htons( data - buf );
- memcpy( nameoff, &ashort, sizeof( ashort ));
+ memcpy( l_nameoff, &ashort, sizeof( ashort ));
+ data = set_name(data, dir->d_m_name, 0);
+ }
+ if ( utf_nameoff ) {
+ ashort = htons( data - buf );
+ memcpy( utf_nameoff, &ashort, sizeof( ashort ));
data = set_name(data, dir->d_m_name, utf8);
}
if ( isad ) {
if (of_stat(s_path) < 0) {
return AFPERR_MISC;
}
+ curdir->offcnt++;
if ((dir = adddir( vol, curdir, s_path)) == NULL) {
return AFPERR_MISC;
}
/*
- * $Id: file.c,v 1.67 2002-10-13 21:30:55 didg Exp $
+ * $Id: file.c,v 1.68 2002-10-25 11:10:48 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#ifndef USE_LASTDID
struct stat lst, *lstp;
#endif /* USE_LASTDID */
- char *data, *nameoff = NULL, *upath;
+ char *data, *l_nameoff = NULL, *upath;
+ char *utf_nameoff = NULL;
int bit = 0;
u_int32_t aint;
u_int16_t ashort;
break;
case FILPBIT_LNAME :
- nameoff = data;
+ l_nameoff = data;
data += sizeof( u_int16_t );
break;
case FILPBIT_PDINFO :
if (afp_version >= 30) { /* UTF8 name */
utf8 = kTextEncodingUTF8;
- nameoff = data;
+ utf_nameoff = data;
data += sizeof( u_int16_t );
aint = 0;
memcpy(data, &aint, sizeof( aint ));
bitmap = bitmap>>1;
bit++;
}
- if ( nameoff ) {
+ if ( l_nameoff ) {
ashort = htons( data - buf );
- memcpy(nameoff, &ashort, sizeof( ashort ));
+ memcpy(l_nameoff, &ashort, sizeof( ashort ));
+ data = set_name(data, path, 0);
+ }
+ if ( utf_nameoff ) {
+ ashort = htons( data - buf );
+ memcpy(utf_nameoff, &ashort, sizeof( ashort ));
data = set_name(data, path, utf8);
}
*buflen = data - buf;
ad_close( adp, ADFLAGS_DF|ADFLAGS_HF );
createfile_done:
+ curdir->offcnt++;
#ifdef DROPKLUDGE
if (vol->v_flags & AFPVOL_DROPBOX) {
if ( (err = copyfile(p, upath , newname, vol_noadouble(vol))) < 0 ) {
return err;
}
+ curdir->offcnt++;
#ifdef DROPKLUDGE
if (vol->v_flags & AFPVOL_DROPBOX) {
/*
- * $Id: filedir.c,v 1.34 2002-10-13 06:18:13 didg Exp $
+ * $Id: filedir.c,v 1.35 2002-10-25 11:10:48 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#endif /* CNID_DB */
}
if ( rc == AFP_OK ) {
+ curdir->offcnt--;
setvoltime(obj, vol );
}
rc = moveandrename(vol, sdir, oldname, newname, isdir);
if ( rc == AFP_OK ) {
+ curdir->offcnt++;
+ sdir->offcnt--;
+
char *upath = mtoupath(vol, newname);
#ifdef DROPKLUDGE
if (vol->v_flags & AFPVOL_DROPBOX) {