summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/chgpasswd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index c22f268684..734f72c08d 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -60,7 +60,8 @@ static int findpty(char **slave)
int master;
#ifndef HAVE_GRANTPT
static fstring line;
- void *dirp;
+ DIR *dirp;
+ struct dirent *dentry;
char *dpname;
#endif /* !HAVE_GRANTPT */
@@ -82,10 +83,11 @@ static int findpty(char **slave)
#else /* HAVE_GRANTPT */
fstrcpy( line, "/dev/ptyXX" );
- dirp = OpenDir(NULL, "/dev", False);
+ dirp = opendir("/dev");
if (!dirp)
return(-1);
- while ((dpname = ReadDirName(dirp)) != NULL) {
+ while ((dentry = readdir(dirp)) != NULL) {
+ dpname = dentry->d_name;
if (strncmp(dpname, "pty", 3) == 0 && strlen(dpname) == 5) {
DEBUG(3,("pty: try to open %s, line was %s\n", dpname, line ) );
line[8] = dpname[3];
@@ -94,12 +96,12 @@ static int findpty(char **slave)
DEBUG(3,("pty: opened %s\n", line ) );
line[5] = 't';
*slave = line;
- CloseDir(dirp);
+ closedir(dirp);
return (master);
}
}
}
- CloseDir(dirp);
+ closedir(dirp);
#endif /* HAVE_GRANTPT */
return (-1);
}