void *private_data)
{
struct add_fd_to_close_entry_state *state = private_data;
+ int fd = fsp_get_pathref_fd(state->fsp);
TDB_DATA values[] = {
value,
- { .dptr = (uint8_t *)&(state->fsp->fh->fd),
- .dsize = sizeof(state->fsp->fh->fd) },
+ { .dptr = (uint8_t *)&fd,
+ .dsize = sizeof(fd) },
};
NTSTATUS status;
* open file description lock semantics which only removes
* locks on the file descriptor we're closing. Just close.
*/
- return close(fsp->fh->fd);
+ return close(fsp_get_pathref_fd(fsp));
}
if (get_lock_ref_count(fsp)) {
* Finally close the fd associated with this fsp.
*/
- return close(fsp->fh->fd);
+ return close(fsp_get_pathref_fd(fsp));
}
/****************************************************************************
static struct files_struct *close_fsp_fd(struct files_struct *fsp,
void *private_data)
{
- if ((fsp->fh != NULL) && (fsp->fh->fd != -1)) {
- close(fsp->fh->fd);
+ if ((fsp->fh != NULL) && (fsp_get_pathref_fd(fsp) != -1)) {
+ close(fsp_get_pathref_fd(fsp));
fsp_set_fd(fsp, -1);
}
return NULL;
break;
case FRUIT_META_NETATALK:
- ret = close(fsp->fh->fd);
+ ret = close(fsp_get_pathref_fd(fsp));
fsp_set_fd(fsp, -1);
break;
break;
case FRUIT_RSRC_XATTR:
- ret = close(fsp->fh->fd);
+ ret = close(fsp_get_pathref_fd(fsp));
fsp_set_fd(fsp, -1);
break;
int ret;
int fd;
- fd = fsp->fh->fd;
+ fd = fsp_get_pathref_fd(fsp);
DBG_DEBUG("Path [%s] fd [%d]\n", smb_fname_str_dbg(fsp->fsp_name), fd);
int ret;
int fd;
- fd = fsp->fh->fd;
+ fd = fsp_get_pathref_fd(fsp);
DBG_DEBUG("streams_xattr_close called [%s] fd [%d]\n",
smb_fname_str_dbg(fsp->fsp_name), fd);
if (fsp->dptr) {
dptr_CloseDir(fsp);
}
- if (fsp->fh->fd == -1) {
+ if (fsp_get_pathref_fd(fsp) == -1) {
/*
* Either a directory where the dptr_CloseDir() already closed
* the fd or a stat open.