diff options
author | Adam Jackson <ajax@redhat.com> | 2010-10-27 18:44:53 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2010-10-27 18:46:57 -0400 |
commit | 0a1ff35c70730160973715b82112cd97c62ac13e (patch) | |
tree | b02a41ec1eaf9650d763e14e536b3b7088ea7bdd /xf86drm.c | |
parent | 057fab3382c02af54126ce395c43d4e6dce9439a (diff) |
s/drmStrdup/strdup/
_DRM_MALLOC hasn't been a relevant concern since we split libdrm out
from xserver.
Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'xf86drm.c')
-rw-r--r-- | xf86drm.c | 25 |
1 files changed, 4 insertions, 21 deletions
@@ -155,23 +155,6 @@ void drmFree(void *pt) free(pt); } -/* drmStrdup can't use strdup(3), since it doesn't call _DRM_MALLOC... */ -static char *drmStrdup(const char *s) -{ - char *retval; - - if (!s) - return NULL; - - retval = malloc(strlen(s)+1); - if (!retval) - return NULL; - - strcpy(retval, s); - - return retval; -} - /** * Call ioctl, restarting if it is interupted */ @@ -726,11 +709,11 @@ static void drmCopyVersion(drmVersionPtr d, const drm_version_t *s) d->version_minor = s->version_minor; d->version_patchlevel = s->version_patchlevel; d->name_len = s->name_len; - d->name = drmStrdup(s->name); + d->name = strdup(s->name); d->date_len = s->date_len; - d->date = drmStrdup(s->date); + d->date = strdup(s->date); d->desc_len = s->desc_len; - d->desc = drmStrdup(s->desc); + d->desc = strdup(s->desc); } @@ -2543,5 +2526,5 @@ char *drmGetDeviceNameFromFd(int fd) if (i == DRM_MAX_MINOR) return NULL; - return drmStrdup(name); + return strdup(name); } |