This VFS function should really return an NTSTATUS but that is
a patch for another day.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
int fd;
int ret = -1;
NTSTATUS status;
+ int saved_errno = 0;
snapdir = shadow_copy2_find_snapdir(tmp_ctx, handle, fsp->fsp_name);
if (snapdir == NULL) {
ret = 0;
done:
+ if (ret != 0) {
+ saved_errno = errno;
+ }
TALLOC_FREE(fspcwd );
if (p != NULL) {
SMB_VFS_NEXT_CLOSEDIR(handle, p);
file_free(NULL, dirfsp);
}
TALLOC_FREE(tmp_ctx);
+ if (saved_errno != 0) {
+ errno = saved_errno;
+ }
return ret;
}