Since jb@ fixed the type of dd_lock in <dirent.h>, these casts are no

longer required.
This commit is contained in:
des 2007-12-03 14:33:51 +00:00
parent b629c07846
commit e6b2882442
4 changed files with 11 additions and 11 deletions

View File

@ -54,7 +54,7 @@ closedir(dirp)
int fd;
if (__isthreaded)
_pthread_mutex_lock((void *)&dirp->dd_lock);
_pthread_mutex_lock(&dirp->dd_lock);
_seekdir(dirp, dirp->dd_rewind); /* free seekdir storage */
fd = dirp->dd_fd;
dirp->dd_fd = -1;
@ -62,8 +62,8 @@ closedir(dirp)
free((void *)dirp->dd_buf);
_reclaim_telldir(dirp);
if (__isthreaded) {
_pthread_mutex_unlock((void *)&dirp->dd_lock);
_pthread_mutex_destroy((void *)&dirp->dd_lock);
_pthread_mutex_unlock(&dirp->dd_lock);
_pthread_mutex_destroy(&dirp->dd_lock);
}
free((void *)dirp);
return(_close(fd));

View File

@ -87,9 +87,9 @@ readdir(dirp)
struct dirent *dp;
if (__isthreaded) {
_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_lock(&dirp->dd_lock);
dp = _readdir_unlocked(dirp);
_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_unlock(&dirp->dd_lock);
}
else
dp = _readdir_unlocked(dirp);
@ -108,10 +108,10 @@ readdir_r(dirp, entry, result)
saved_errno = errno;
errno = 0;
if (__isthreaded) {
_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_lock(&dirp->dd_lock);
if ((dp = _readdir_unlocked(dirp)) != NULL)
memcpy(entry, dp, _GENERIC_DIRSIZ(dp));
_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_unlock(&dirp->dd_lock);
}
else if ((dp = _readdir_unlocked(dirp)) != NULL)
memcpy(entry, dp, _GENERIC_DIRSIZ(dp));

View File

@ -52,8 +52,8 @@ seekdir(dirp, loc)
long loc;
{
if (__isthreaded)
_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_lock(&dirp->dd_lock);
_seekdir(dirp, loc);
if (__isthreaded)
_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_unlock(&dirp->dd_lock);
}

View File

@ -64,13 +64,13 @@ telldir(dirp)
if ((lp = (struct ddloc *)malloc(sizeof(struct ddloc))) == NULL)
return (-1);
if (__isthreaded)
_pthread_mutex_lock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_lock(&dirp->dd_lock);
lp->loc_index = dirp->dd_td->td_loccnt++;
lp->loc_seek = dirp->dd_seek;
lp->loc_loc = dirp->dd_loc;
LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe);
if (__isthreaded)
_pthread_mutex_unlock((pthread_mutex_t *)&dirp->dd_lock);
_pthread_mutex_unlock(&dirp->dd_lock);
return (lp->loc_index);
}