]> sigrok.org Git - libserialport.git/commit
use readdir() instead of the deprecated readir_r()
authorAurelien Jacobs <redacted>
Fri, 14 Oct 2016 21:50:08 +0000 (23:50 +0200)
committerAurelien Jacobs <redacted>
Fri, 14 Oct 2016 21:58:22 +0000 (23:58 +0200)
commitdf3b70a88849a50aad823a7c0a96ae83eb474a32
treee634766e0f7f18cf5497cfb4cb5bf639a839e18e
parentb2359c5c994c90f84b087cc4e463cdccf76ca1d7
use readdir() instead of the deprecated readir_r()

readir() is threadsafe on both linux and freebsd anyway.
The rationale behind the readdir_r() deprecation is in the glibc manual:
https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html

This fixes the following warning with recent glibc:

linux.c: In function ‘list_ports’:
linux.c:197:2: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
  while (!readdir_r(dir, &entry, &result) && result) {
  ^~~~~
freebsd.c
linux.c