Bug #70516 Conditional include of sys/resource.h uses incorrect guard define
Submitted: 3 Oct 2013 22:28 Modified: 4 Oct 2013 13:58
Reporter: Jeremy Cole (Basic Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0,5.1,5.5,5.6,5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: getrlimit, getrusage, resource

[3 Oct 2013 22:28] Jeremy Cole
Description:
The conditional #include guard for sys/resource.h is incorrect in mysys/mysys_priv.h:

   23 #ifdef HAVE_GETRUSAGE
   24 #include <sys/resource.h>
   25 #endif

This should instead use HAVE_SYS_RESOURCE_H, as it's possible that HAVE_GETRUSAGE is not defined while HAVE_GETRLIMIT and HAVE_SYS_RESOURCE_H are still defined (and necessary for open-files-limit code).

How to repeat:
Examine the code.

Suggested fix:
Exchange HAVE_GETRUSAGE for HAVE_SYS_RESOURCE_H in the #ifdef.
[4 Oct 2013 0:21] MySQL Verification Team
Thank you for the bug report.
[4 Oct 2013 13:58] Paul DuBois
Fixed in 5.7.3.

Code cleanup. No changelog entry needed.