summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2001-03-07 04:39:31 +0000
committerRichard Sharpe <sharpe@samba.org>2001-03-07 04:39:31 +0000
commit2b22019e426c4bb7a5745a326c302a4e19aa5ff2 (patch)
treecc3a05b13ffcb051ac655b3981c7507ad5aa1986 /source3/libsmb
parent5bf5952fd68f7801e66ece29ccf4b0d5baa26c79 (diff)
downloadsamba-2b22019e426c4bb7a5745a326c302a4e19aa5ff2.tar.gz
samba-2b22019e426c4bb7a5745a326c302a4e19aa5ff2.tar.bz2
samba-2b22019e426c4bb7a5745a326c302a4e19aa5ff2.zip
Fix the definition and implementation of smbc_lseekdir ...
(This used to be commit e628d80d1e0f6ec87b61baeaf64019b43bf7dac8)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/libsmbclient.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 770be06fda..c181780d3a 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -1000,7 +1000,8 @@ off_t smbc_lseek(int fd, off_t offset, int whence)
if (!fe->file) {
- return smbc_lseekdir(fd, offset, whence);
+ errno = EINVAL;
+ return -1; /* Can't lseek a dir ... */
}
@@ -2131,10 +2132,10 @@ struct smbc_dir_list *smbc_check_dir_ent(struct smbc_dir_list *list,
* Routine to seek on a directory
*/
-int smbc_lseekdir(int fd, off_t offset, int whence)
+int smbc_lseekdir(int fd, off_t offset)
{
struct smbc_file *fe;
- struct smbc_dirent *dirent = (struct smbc_dirent *)whence;
+ struct smbc_dirent *dirent = (struct smbc_dirent *)offset;
struct smbc_dir_list *list_ent = NULL;
if (!smbc_initialized) {
@@ -2169,10 +2170,10 @@ int smbc_lseekdir(int fd, off_t offset, int whence)
/* Now, check what we were passed and see if it is OK ... */
- if (!whence) {
+ if (dirent == NULL) { /* Seek to the begining of the list */
- errno = EINVAL;
- return -1;
+ fe->dir_next = fe->dir_list;
+ return 0;
}