summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-08-23 21:29:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:01:12 -0500
commitb67ba1e36b11aa140822f92b148438a1387d4d9d (patch)
tree8f9b5b7b36fb0050df72f4667a6da9d79e068023 /source3
parent7dd03e891e3aa06aa000e9bea8e0bad8ede34c8c (diff)
downloadsamba-b67ba1e36b11aa140822f92b148438a1387d4d9d.tar.gz
samba-b67ba1e36b11aa140822f92b148438a1387d4d9d.tar.bz2
samba-b67ba1e36b11aa140822f92b148438a1387d4d9d.zip
r9545: (Hopefully the last) fixes for DIR -> SMB_STRUCT_DIR.
Jeremy. (This used to be commit b242f278601e1a23c9116009482e802326d418f7)
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c10
-rw-r--r--source3/client/smbspool.c6
-rw-r--r--source3/lib/system.c4
-rw-r--r--source3/smbd/chgpasswd.c8
-rw-r--r--source3/smbd/msdfs.c2
5 files changed, 16 insertions, 14 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index d22f1245fa..61c4c8e4be 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -1379,7 +1379,7 @@ static int cmd_select(void)
static int file_find(struct file_list **list, const char *directory,
const char *expression, BOOL match)
{
- DIR *dir;
+ SMB_STRUCT_DIR *dir;
struct file_list *entry;
struct stat statbuf;
int ret;
@@ -1387,7 +1387,7 @@ static int file_find(struct file_list **list, const char *directory,
BOOL isdir;
const char *dname;
- dir = opendir(directory);
+ dir = sys_opendir(directory);
if (!dir)
return -1;
@@ -1416,14 +1416,14 @@ static int file_find(struct file_list **list, const char *directory,
if (ret == -1) {
SAFE_FREE(path);
- closedir(dir);
+ sys_closedir(dir);
return -1;
}
}
entry = SMB_MALLOC_P(struct file_list);
if (!entry) {
d_printf("Out of memory in file_find\n");
- closedir(dir);
+ sys_closedir(dir);
return -1;
}
entry->file_path = path;
@@ -1434,7 +1434,7 @@ static int file_find(struct file_list **list, const char *directory,
}
}
- closedir(dir);
+ sys_closedir(dir);
return 0;
}
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 16b071af19..b1c17a26fc 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -288,7 +288,7 @@ list_devices(void)
static
char * get_ticket_cache( uid_t uid )
{
- DIR *tcdir; /* directory where ticket caches are stored */
+ SMB_STRUCT_DIR *tcdir; /* directory where ticket caches are stored */
SMB_STRUCT_DIRENT *dirent; /* directory entry */
char *filename = NULL; /* holds file names on the tmp directory */
SMB_STRUCT_STAT buf;
@@ -298,7 +298,7 @@ char * get_ticket_cache( uid_t uid )
time_t t = 0;
snprintf(user_cache_prefix, CC_MAX_FILE_LEN, "%s%d", CC_PREFIX, uid );
- tcdir = opendir( TICKET_CC_DIR );
+ tcdir = sys_opendir( TICKET_CC_DIR );
if ( tcdir == NULL )
return NULL;
@@ -331,6 +331,8 @@ char * get_ticket_cache( uid_t uid )
}
}
+ sys_closedir(tcdir);
+
if ( ticket_file == NULL )
{
/* no ticket cache found */
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 227cbadf8e..caad95840c 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -960,7 +960,7 @@ FILE *wsys_fopen(const smb_ucs2_t *wfname, const char *type)
Wide opendir. Just narrow and call sys_xxx.
****************************************************************************/
-DIR *wsys_opendir(const smb_ucs2_t *wfname)
+SMB_STRUCT_DIR *wsys_opendir(const smb_ucs2_t *wfname)
{
pstring fname;
return opendir(unicode_to_unix(fname,wfname,sizeof(fname)));
@@ -970,7 +970,7 @@ DIR *wsys_opendir(const smb_ucs2_t *wfname)
Wide readdir. Return a structure pointer containing a wide filename.
****************************************************************************/
-SMB_STRUCT_WDIRENT *wsys_readdir(DIR *dirp)
+SMB_STRUCT_WDIRENT *wsys_readdir(SMB_STRUCT_DIR *dirp)
{
static SMB_STRUCT_WDIRENT retval;
SMB_STRUCT_DIRENT *dirval = sys_readdir(dirp);
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index f445ca3365..374c57a083 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -64,7 +64,7 @@ static int findpty(char **slave)
{
int master;
static fstring line;
- DIR *dirp;
+ SMB_STRUCT_DIR *dirp;
const char *dpname;
#if defined(HAVE_GRANTPT)
@@ -93,7 +93,7 @@ static int findpty(char **slave)
fstrcpy(line, "/dev/ptyXX");
- dirp = opendir("/dev");
+ dirp = sys_opendir("/dev");
if (!dirp)
return (-1);
while ((dpname = readdirname(dirp)) != NULL)
@@ -110,12 +110,12 @@ static int findpty(char **slave)
DEBUG(3, ("pty: opened %s\n", line));
line[5] = 't';
*slave = line;
- closedir(dirp);
+ sys_closedir(dirp);
return (master);
}
}
}
- closedir(dirp);
+ sys_closedir(dirp);
return (-1);
}
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 2b13e2a4b5..1e6306382a 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -1010,7 +1010,7 @@ BOOL remove_msdfs_link(struct junction_map *jucn)
static int form_junctions(TALLOC_CTX *ctx, int snum, struct junction_map *jucn, int jn_remain)
{
int cnt = 0;
- DIR *dirp;
+ SMB_STRUCT_DIR *dirp;
char* dname;
pstring connect_path;
char* service_name = lp_servicename(snum);