/* * NAME: hfs->fsetattr() * DESCRIPTION: change an open file's attributes */ int hfs_fsetattr(hfsfile *file, const hfsdirent *ent) { if (file->vol->flags & HFS_VOL_READONLY) ERROR(EROFS, 0); r_packdirent(&file->cat, ent); file->flags |= HFS_FILE_UPDATE_CATREC; return 0; fail: return -1; }
/* * NAME: hfs->fsetattr() * DESCRIPTION: change an open file's attributes */ int hfs_fsetattr(hfsfile *file, hfsdirent *ent) { if (file->vol->flags & HFS_READONLY) { ERROR(EROFS, 0); return -1; } r_packdirent(&file->cat, ent); file->flags |= HFS_UPDATE_CATREC; return 0; }
/* * NAME: hfs->setattr() * DESCRIPTION: change a file's attributes */ int hfs_setattr(hfsvol *vol, const char *path, const hfsdirent *ent) { CatDataRec data; node n; if (getvol(&vol) == -1 || v_resolve(&vol, path, &data, 0, 0, &n) <= 0) goto fail; if (vol->flags & HFS_VOL_READONLY) ERROR(EROFS, 0); r_packdirent(&data, ent); return v_putcatrec(&data, &n); fail: return -1; }
/* * NAME: hfs->setattr() * DESCRIPTION: change a file's attributes */ int hfs_setattr(hfsvol *vol, char *path, hfsdirent *ent) { CatDataRec data; node n; if (v_getvol(&vol) < 0 || v_resolve(&vol, path, &data, 0, 0, &n) <= 0) return -1; if (vol->flags & HFS_READONLY) { ERROR(EROFS, 0); return -1; } r_packdirent(&data, ent); if (v_putcatrec(&data, &n) < 0) return -1; return 0; }