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

2016-06-02 Thread Chris Patterson
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

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

2016-06-02 Thread Ian Jackson
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) { > ...

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

2016-06-02 Thread Chris Patterson
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) { >> -

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

2016-06-02 Thread Ian Jackson
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);

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

2016-06-01 Thread Chris Patterson
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