[CONC-156] CONC 2.2.2 build fails on FreeBSD due to not including necessary header. Created: 2016-02-11  Updated: 2016-02-11  Resolved: 2016-02-11

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 2.2.2
Fix Version/s: 2.2.3, 3.0.1

Type: Bug Priority: Major
Reporter: Ardie H. Hwang Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

FreeBSD 10.2-RELEASE, CMake 3.4.2, FreeBSD Clang 3.4.1


Attachments: Text File CONC-2.2.0-FreeBSD.patch    

 Description   

On FreeBSD, building CONC 2.2.2 fails with following error message:

Clang Error Message

/root/mariadb/libmariadb/violite.c:565:44: error: use of undeclared identifier 'TCP_NODELAY'
      if (setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void *) &nodelay,
                                           ^

On libmariadb/violite.c:53, there is this preprocessor condition that keeps FreeBSD from including TCP related constants:

#if !defined(MSDOS) && !defined(_WIN32) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__FreeBSD__)

`TCP_NODELAY` is defined in <netinet/tcp.h> on FreeBSD, so to build without the error above, the `!defined(_FreeBSD_)` needs to be deleted. AFAIK this removal will not cause serious side effects, since all three header files affected by the condition are existing on FreeBSD.



 Comments   
Comment by Ardie H. Hwang [ 2016-02-11 ]

Edit: 2.2.0 -> 2.2.2.

Sorry, my mistake.

Comment by Georg Richter [ 2016-02-11 ]

Thanks for your bug report and patch!

Connector/C 3.0.0 alpha is not affected due to new pvio implementation.

Comment by Georg Richter [ 2016-02-11 ]

Fixed in 2.2.3
commit f1cde3d67a8b5b2de5f9af8c6bea5717bc6568a7
Author: Georg Richter <georg@mariadb.com>
Date: Thu Feb 11 09:27:41 2016 +0100

  • Fix for CONC-156: CONC 2.2.2 build fails on FreeBSD due to not
    including necessary header.
    Thanks to Andie H. Hwang for providing this patch!
Generated at Thu Feb 08 03:03:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.