Re: [PATCH v8 1/6] tests: use /dev/fd to count open fds
On Mon, 4 Mar 2019 13:53:56 +0200 Pekka Paalanen wrote: > On Wed, 27 Feb 2019 21:13:08 +0200 > Leonid Bobrov wrote: > > > *BSD don't have /proc/self/fd, they use /dev/fd instead. > > At Linux /dev/fd is a symlink to /proc/self/fd > > > > Signed-off-by: Leonid Bobrov > > --- > > tests/test-helpers.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/tests/test-helpers.c b/tests/test-helpers.c > > index b2189d8..03419fb 100644 > > --- a/tests/test-helpers.c > > +++ b/tests/test-helpers.c > > @@ -47,8 +47,8 @@ count_open_fds(void) > > struct dirent *ent; > > int count = 0; > > > > - dir = opendir("/proc/self/fd"); > > - assert(dir && "opening /proc/self/fd failed."); > > + dir = opendir("/dev/fd"); > > + assert(dir && "opening /dev/fd failed."); > > > > errno = 0; > > while ((ent = readdir(dir))) { > > @@ -57,7 +57,7 @@ count_open_fds(void) > > continue; > > count++; > > } > > - assert(errno == 0 && "reading /proc/self/fd failed."); > > + assert(errno == 0 && "reading /dev/fd failed."); > > > > closedir(dir); > > > > Hi, > > this patch works for me, and is a candidate for landing without BSD CI. > > Reviewed-by: Pekka Paalanen > > (Leonid, this kind of reply means that I'm ok with the patch, and will > merge it a day or two later unless someone disagrees.) Hi, I have to take that back. I was just told this: < mazocomp> pq: on all BSDs /dev/fd always contains 64 files, still that patch comes from FreeBSD < mazocomp> pq: it doesn't actually work, it just points to the common path. In other words, this patch is not going fix anything, it does not even move things in the right direction. We have to drop this as it is. Thanks, pq pgpfjAFz822tR.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH v8 1/6] tests: use /dev/fd to count open fds
On Wed, 27 Feb 2019 21:13:08 +0200 Leonid Bobrov wrote: > *BSD don't have /proc/self/fd, they use /dev/fd instead. > At Linux /dev/fd is a symlink to /proc/self/fd > > Signed-off-by: Leonid Bobrov > --- > tests/test-helpers.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tests/test-helpers.c b/tests/test-helpers.c > index b2189d8..03419fb 100644 > --- a/tests/test-helpers.c > +++ b/tests/test-helpers.c > @@ -47,8 +47,8 @@ count_open_fds(void) > struct dirent *ent; > int count = 0; > > - dir = opendir("/proc/self/fd"); > - assert(dir && "opening /proc/self/fd failed."); > + dir = opendir("/dev/fd"); > + assert(dir && "opening /dev/fd failed."); > > errno = 0; > while ((ent = readdir(dir))) { > @@ -57,7 +57,7 @@ count_open_fds(void) > continue; > count++; > } > - assert(errno == 0 && "reading /proc/self/fd failed."); > + assert(errno == 0 && "reading /dev/fd failed."); > > closedir(dir); > Hi, this patch works for me, and is a candidate for landing without BSD CI. Reviewed-by: Pekka Paalanen (Leonid, this kind of reply means that I'm ok with the patch, and will merge it a day or two later unless someone disagrees.) Thanks, pq pgpj2oxyHNWjH.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v8 1/6] tests: use /dev/fd to count open fds
*BSD don't have /proc/self/fd, they use /dev/fd instead. At Linux /dev/fd is a symlink to /proc/self/fd Signed-off-by: Leonid Bobrov --- tests/test-helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test-helpers.c b/tests/test-helpers.c index b2189d8..03419fb 100644 --- a/tests/test-helpers.c +++ b/tests/test-helpers.c @@ -47,8 +47,8 @@ count_open_fds(void) struct dirent *ent; int count = 0; - dir = opendir("/proc/self/fd"); - assert(dir && "opening /proc/self/fd failed."); + dir = opendir("/dev/fd"); + assert(dir && "opening /dev/fd failed."); errno = 0; while ((ent = readdir(dir))) { @@ -57,7 +57,7 @@ count_open_fds(void) continue; count++; } - assert(errno == 0 && "reading /proc/self/fd failed."); + assert(errno == 0 && "reading /dev/fd failed."); closedir(dir); -- 2.20.1 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel