X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Freaddir.c;h=ab42dfd2023f3e1127f7218d08452df8393b8a9f;hp=38bc66e0ca6d1fee172eaee57dd6f04c40b2621d;hb=6a14f1c2502f58ff7bed8cb451f95a83f5ee920a;hpb=e9f5144537a4d89cc875bce42b269d1e2b119d8f diff --git a/daemon/readdir.c b/daemon/readdir.c index 38bc66e..ab42dfd 100644 --- a/daemon/readdir.c +++ b/daemon/readdir.c @@ -1,5 +1,5 @@ /* libguestfs - the guestfsd daemon - * Copyright (C) 2009 Red Hat Inc. + * Copyright (C) 2009 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include "actions.h" guestfs_int_dirent_list * -do_readdir (char *path) +do_readdir (const char *path) { guestfs_int_dirent_list *ret; guestfs_int_dirent v; @@ -36,9 +36,6 @@ do_readdir (char *path) struct dirent *d; int i; - NEED_ROOT (NULL); - ABS_PATH (path, NULL); - ret = malloc (sizeof *ret); if (ret == NULL) { reply_with_perror ("malloc"); @@ -63,7 +60,7 @@ do_readdir (char *path) guestfs_int_dirent *p; p = realloc (ret->guestfs_int_dirent_list_val, - sizeof (guestfs_int_dirent) * (i+1)); + sizeof (guestfs_int_dirent) * (i+1)); v.name = strdup (d->d_name); if (!p || !v.name) { reply_with_perror ("allocate");