summaryrefslogtreecommitdiff
path: root/source/smbwrapper/smbw_dir.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-05 01:42:46 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-05 01:42:46 +0000
commit6a1b346d98c10688f0995a6ab8fd155a77ead258 (patch)
tree5df5b3e5bee2107f59434c3d7f443b7bcf5cf182 /source/smbwrapper/smbw_dir.c
parentbdf02378c634e0d18f4f2de7a74b2f2fc5965e9a (diff)
downloadsamba-6a1b346d98c10688f0995a6ab8fd155a77ead258.tar.gz
this gets smbwrapper working under Solaris 2.6. Not tested much yet.
Diffstat (limited to 'source/smbwrapper/smbw_dir.c')
-rw-r--r--source/smbwrapper/smbw_dir.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/smbwrapper/smbw_dir.c b/source/smbwrapper/smbw_dir.c
index 913fc9662ea..bd8c91682eb 100644
--- a/source/smbwrapper/smbw_dir.c
+++ b/source/smbwrapper/smbw_dir.c
@@ -31,9 +31,6 @@ extern int DEBUGLEVEL;
extern int smbw_busy;
-#define DIRP_SIZE (sizeof(fstring) + 12)
-
-
/*****************************************************
map a fd to a smbw_dir structure
*******************************************************/
@@ -641,11 +638,13 @@ read one entry from a directory
struct dirent *smbw_readdir(DIR *dirp)
{
struct smbw_dir *d = (struct smbw_dir *)dirp;
- static char buf[DIRP_SIZE];
- struct dirent *de = (struct dirent *)buf;
+ static union {
+ char buf[DIRP_SIZE];
+ struct dirent de;
+ } dbuf;
- if (smbw_getdents(d->fd, de, DIRP_SIZE) > 0)
- return de;
+ if (smbw_getdents(d->fd, &dbuf.de, DIRP_SIZE) > 0)
+ return &dbuf.de;
return NULL;
}