diff options
author | Eric Anholt <anholt@freebsd.org> | 2003-10-22 22:08:53 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2003-10-22 22:08:53 +0000 |
commit | 86e6325e5ab848c15c422f20133445fe6c1caa09 (patch) | |
tree | 8c4699b4ddac738ed005d5f4aedd9dae4c628bed /bsd/drm_drv.h | |
parent | 4e6ddcbb698c029b407d5dc43348c6e422a36705 (diff) |
- Add DRM_GET_PRIV_WITH_RETURN macro. This can be used in shared code to
get the drm_file_t * based on the filp passed in ioctl handlers.
- Use this macro on BSD for simplification and improve its error reporting.
Make failure to find the drm_file_t * print as an error, not debug.
This failure may be part of the problem with KDE.
- Make debug and error print macros include the pid on BSD.
Diffstat (limited to 'bsd/drm_drv.h')
-rw-r--r-- | bsd/drm_drv.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/bsd/drm_drv.h b/bsd/drm_drv.h index 7d753836..582a4112 100644 --- a/bsd/drm_drv.h +++ b/bsd/drm_drv.h @@ -824,7 +824,7 @@ int DRM(close)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p) priv = DRM(find_file_by_proc)(dev, p); if (!priv) { DRM_UNLOCK(); - DRM_DEBUG("can't find authenticator\n"); + DRM_ERROR("can't find authenticator\n"); return EINVAL; } @@ -938,13 +938,7 @@ int DRM(ioctl)(dev_t kdev, u_long cmd, caddr_t data, int flags, int nr = DRM_IOCTL_NR(cmd); drm_file_t *priv; - DRM_LOCK(); - priv = (drm_file_t *) DRM(find_file_by_proc)(dev, p); - DRM_UNLOCK(); - if (priv == NULL) { - DRM_DEBUG("can't find authenticator\n"); - return EINVAL; - } + DRM_GET_PRIV_WITH_RETURN(priv, (DRMFILE)DRM_CURRENTPID); atomic_inc( &dev->counts[_DRM_STAT_IOCTLS] ); ++priv->ioctl_count; |