[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [[PATCH v2 2/2] libxl: replace deprecated readdir_r() with readdir()



Chris Patterson writes ("[[PATCH v2 2/2] libxl: replace deprecated readdir_r() 
with readdir()"):
> -    for (;;) {
> +    while ((de = readdir(dir)) != NULL) {
...
> -        int r = readdir_r(dir, de_buf, &de);
> -        if (r) {
> -            LOGE(ERROR, "failed to readdir %s", SYSFS_USB_DEV);
> -            break;

Sadly this is not right because it mishandles errors when reading the
directory, treating them all as EOF.  See the error handling info
in the specification for readdir:
  http://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.