Use the correct types for the functions rst_opendir(), glob_readdir() and

rst_closedir() which are called by glob().

Reviewed by:	md5
Approved by:	das (mentor)
This commit is contained in:
stefanf 2004-05-24 16:24:26 +00:00
parent 2edc0418f9
commit 5857c0ba2a
3 changed files with 11 additions and 9 deletions

View File

@ -489,7 +489,7 @@ rst_readdir(RST_DIR *dirp)
/*
* Simulate the opening of a directory
*/
RST_DIR *
void *
rst_opendir(const char *name)
{
struct inotab *itp;
@ -509,9 +509,11 @@ rst_opendir(const char *name)
* In our case, there is nothing to do when closing a directory.
*/
void
rst_closedir(RST_DIR *dirp)
rst_closedir(void *arg)
{
RST_DIR *dirp;
dirp = arg;
(void)close(dirp->dd_fd);
free(dirp);
return;

View File

@ -81,9 +81,9 @@ void removeoldleaves(void);
void removeoldnodes(void);
void renameit(char *, char *);
int reply(char *);
RST_DIR *rst_opendir(const char *);
void *rst_opendir(const char *);
struct direct *rst_readdir(RST_DIR *);
void rst_closedir(RST_DIR *dirp);
void rst_closedir(void *);
void runcmdshell(void);
char *savename(char *);
void setdirmodes(int);

View File

@ -83,7 +83,7 @@ static char *copynext(char *, char *);
static int fcmp(const void *, const void *);
static void formatf(struct afile *, int);
static void getcmd(char *, char *, char *, int, struct arglist *);
struct dirent *glob_readdir(RST_DIR *dirp);
struct dirent *glob_readdir(void *);
static int glob_stat(const char *, struct stat *);
static void mkentry(char *, struct direct *, struct afile *);
static void printlist(char *, char *);
@ -104,9 +104,9 @@ runcmdshell(void)
arglist.freeglob = 0;
arglist.argcnt = 0;
arglist.glob.gl_flags = GLOB_ALTDIRFUNC;
arglist.glob.gl_opendir = (void *)rst_opendir;
arglist.glob.gl_readdir = (void *)glob_readdir;
arglist.glob.gl_closedir = (void *)rst_closedir;
arglist.glob.gl_opendir = rst_opendir;
arglist.glob.gl_readdir = glob_readdir;
arglist.glob.gl_closedir = rst_closedir;
arglist.glob.gl_lstat = glob_stat;
arglist.glob.gl_stat = glob_stat;
canon("/", curdir, sizeof(curdir));
@ -701,7 +701,7 @@ formatf(struct afile *list, int nentry)
#undef d_ino
struct dirent *
glob_readdir(RST_DIR *dirp)
glob_readdir(void *dirp)
{
struct direct *dp;
static struct dirent adirent;