From: Ralph Boehme Date: Mon, 10 Dec 2012 14:04:24 +0000 (+0100) Subject: Use ad_getid() instead of ad_forcegetid() X-Git-Url: https://arthur.barton.de/gitweb/?p=netatalk.git;a=commitdiff_plain;h=06c0bfaea7c9db5d404813efd23bf06c49c2bc4f Use ad_getid() instead of ad_forcegetid() ad_getid() now ignores the db stamp when reading the CNID, so we can simply use it instead of using ad_forcegetid(). --- diff --git a/etc/cnid_dbd/cmd_dbd_scanvol.c b/etc/cnid_dbd/cmd_dbd_scanvol.c index 37012f27..68300b6c 100644 --- a/etc/cnid_dbd/cmd_dbd_scanvol.c +++ b/etc/cnid_dbd/cmd_dbd_scanvol.c @@ -628,15 +628,8 @@ static cnid_t check_cnid(const char *name, cnid_t did, struct stat *st, int adfi dbd_log( LOGDEBUG, "File without meta EA: \"%s/%s\"", cwdbuf, name); adfile_ok = 1; } else { - if (dbd_flags & DBD_FLAGS_FORCE) { - ad_cnid = ad_forcegetid(&ad); - /* This ensures the changed stamp is written */ - ad_setid( &ad, st->st_dev, st->st_ino, ad_cnid, did, stamp); - ad_flush(&ad); - } else - ad_cnid = ad_getid(&ad, st->st_dev, st->st_ino, 0, stamp); - - if (ad_cnid == 0) + ad_cnid = ad_getid(&ad, st->st_dev, st->st_ino, 0, stamp); + if (ad_cnid == CNID_INVALID) dbd_log( LOGSTD, "Bad CNID in adouble file of '%s/%s'", cwdbuf, name); else dbd_log( LOGDEBUG, "CNID from .AppleDouble file for '%s/%s': %u", cwdbuf, name, ntohl(ad_cnid));