Re: [Patch] replace readdir() by g_dir_read_name()



Hi Albrecht,

On 12/12/2018 03:12:29 PM Wed, Albrecht Dreß wrote:
Hi all,

running cppcheck on Balsa/s master sources, I got reports about readdir() not being thread-safe (“portability 
warnings”).  Although there seems to be some confusion about this (see the glibc man page of readdir vs. IEEE 
1003.1-2017), I think the better approach is to use the glib functions which also support other platforms 
like Windows cleanly (NB: the glib implementation uses readdir() for POSIX systems…).

The attached patch replaces readdir() and friends by the glib functions, and also refactors the affected 
functions in libbalsa/folder-scanners.c a little bit as to avoid “continue” statements which (IMHO) make the 
code harder to read.

Opinions?

Cheers,
Albrecht.

Thanks for the patch! Looks good!

Builds and runs, and pushed to master.

Best,

Peter

Attachment: pgp6WMdDvqbhB.pgp
Description: PGP signature



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