* otherwise
**/
static int ad_convert(struct adouble *ad,
- const struct smb_filename *smb_fname,
- int fd)
+ const struct smb_filename *smb_fname)
{
int rc = 0;
char *map = MAP_FAILED;
ad_getentrylen(ad, ADEID_RFORK);
/* FIXME: direct use of mmap(), vfs_aio_fork does it too */
- map = mmap(NULL, origlen, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+ map = mmap(NULL, origlen, PROT_READ|PROT_WRITE, MAP_SHARED,
+ ad->ad_fd, 0);
if (map == MAP_FAILED) {
DEBUG(2, ("mmap AppleDouble: %s\n", strerror(errno)));
return -1;
* FIXME: direct ftruncate(), but we don't have a fsp for the
* VFS call
*/
- rc = ftruncate(fd, ad_getentryoff(ad, ADEID_RFORK)
+ rc = ftruncate(ad->ad_fd, ad_getentryoff(ad, ADEID_RFORK)
+ ad_getentrylen(ad, ADEID_RFORK));
if (rc != 0) {
munmap(map, origlen);
* appended to the ADEID_FINDERI entry.
*/
- ret = ad_convert(ad, smb_fname, ad->ad_fd);
+ ret = ad_convert(ad, smb_fname);
if (ret != 0) {
DBG_WARNING("Failed to convert [%s]\n", smb_fname->base_name);
return len;