NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
450 stars 116 forks source link

rename err() function to avoid clashing with err() form C library #98

Closed ffontaine closed 5 years ago

ffontaine commented 5 years ago

err() is a function available in the C library, so when static linking, there is a clash at link time because the function is provided both by nbd and the C library: http://autobuild.buildroot.org/results/aa8/aa8a1ac35a93e1c8b9fddbc2b5d66ecaa921f31e/build-end.log

Fix that by renaming err() to nbd_err() and providing a small macro wrapper to avoid touching the many call sites.

Signed-off-by: "Yann E. MORIN" yann.morin.1998@free.fr [Retrieved from: https://git.buildroot.net/buildroot/tree/package/nbd/0001-avoid-name-clashing.patch] Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

yoe commented 5 years ago

No problem with that in principle, but the travis build fails with linker errors related to the new nbd_err function. Can you look at that?

ffontaine commented 5 years ago

I updated the PR, I had to update the tests/code/Makefile.am to add libcliserv.la which will now contains nbd_err. We did not see this issue in buildroot as we can't run check when cross-compiling