On Thu, Jun 2, 2016 at 12:13 PM, Ian Jackson wrote:
> Chris Patterson writes ("Re: [[PATCH v2 2/2] libxl: replace deprecated
> readdir_r() with readdir()"):
>> You're right, it should check for the error afterwards.
>>
>> How about something along the lines of:
>>
>> int saved_errno = errno;
>> e
Chris Patterson writes ("Re: [[PATCH v2 2/2] libxl: replace deprecated
readdir_r() with readdir()"):
> You're right, it should check for the error afterwards.
>
> How about something along the lines of:
>
> int saved_errno = errno;
> errno = 0;
> while ((de = readdir(dir)) != NULL) {
> ...
On Thu, Jun 2, 2016 at 6:11 AM, Ian Jackson wrote:
> 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) {
>> -
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);
From: Chris Patterson
Replace the usage of readdir_r() with readdir() to address a
compilation error under glibc due to the deprecation of readdir_r
for their next release (2.24) [1, 2].
Remove code specific to usage of readdir_r which is no longer required,
such as zalloc_dirent().
--
From th