From 5857c0ba2aca54349d8d4f44c70397b575a20bd9 Mon Sep 17 00:00:00 2001 From: stefanf Date: Mon, 24 May 2004 16:24:26 +0000 Subject: 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) --- sbin/restore/dirs.c | 6 ++++-- sbin/restore/extern.h | 4 ++-- sbin/restore/interactive.c | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'sbin/restore') diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index 0d66ba5..327d3ed 100644 --- a/sbin/restore/dirs.c +++ b/sbin/restore/dirs.c @@ -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; diff --git a/sbin/restore/extern.h b/sbin/restore/extern.h index 9edf6f9..603a561 100644 --- a/sbin/restore/extern.h +++ b/sbin/restore/extern.h @@ -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); diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c index 2f3b231..209c5a5 100644 --- a/sbin/restore/interactive.c +++ b/sbin/restore/interactive.c @@ -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; -- cgit v1.1