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.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.