diff options
author | Stefan Farfeleder <stefanf@FreeBSD.org> | 2004-05-24 16:24:26 +0000 |
---|---|---|
committer | Stefan Farfeleder <stefanf@FreeBSD.org> | 2004-05-24 16:24:26 +0000 |
commit | 1916772e6fd66a6b37fc423e6740bdb7b77dd8d2 (patch) | |
tree | f9361071f649486455d38ecf30af313aa65fe715 /sbin/restore | |
parent | e54fb3f2dc353bdab4e5a7aee5ff36720de7b227 (diff) | |
download | src-1916772e6fd66a6b37fc423e6740bdb7b77dd8d2.tar.gz src-1916772e6fd66a6b37fc423e6740bdb7b77dd8d2.zip |
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)
Notes
Notes:
svn path=/head/; revision=129666
Diffstat (limited to 'sbin/restore')
-rw-r--r-- | sbin/restore/dirs.c | 6 | ||||
-rw-r--r-- | sbin/restore/extern.h | 4 | ||||
-rw-r--r-- | sbin/restore/interactive.c | 10 |
3 files changed, 11 insertions, 9 deletions
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index 0d66ba56e9c6..327d3ed01d9b 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 9edf6f971a0e..603a56105942 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 2f3b231d1174..209c5a54e99d 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; |