Ticket 1117

Summary: Portability issue with get_current_dir_name()
Product: Slurm Reporter: Nicolas Joly <njoly>
Component: OtherAssignee: David Bigagli <david>
Status: RESOLVED FIXED QA Contact:
Severity: 6 - No support contract    
Priority: --- CC: brian, da
Version: 14.11.x   
Hardware: Other   
OS: Other   
Site: -Other- Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 14.11.0pre6 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---
Attachments: get_current_dir_name() portability fix
get_current_dir_name() portability fix v2
get_current_dir_name() portability fix v2

Description Nicolas Joly 2014-09-24 00:13:39 MDT
Created attachment 1255 [details]
get_current_dir_name() portability fix

Hi,

NetBSD does not have get_current_dir_name() function unlike Linux and FreeBSD.

The attached patch add a configure check for this non standard function, and an
fall-back mecanism to get the current directory if unsupported.

Thanks.

NB: I do not include auto-tools regenerated files (with autogen) due to unrelated differences.
Comment 1 Nicolas Joly 2014-09-24 02:17:47 MDT
Hi again,

Forgot that getcwd(NULL, size) is not portable :(
The buffer then need to be allocated first.

Attached an updated patch.
Comment 2 Nicolas Joly 2014-09-24 02:19:05 MDT
Created attachment 1259 [details]
get_current_dir_name() portability fix v2
Comment 3 Nicolas Joly 2014-09-24 02:25:06 MDT
Created attachment 1260 [details]
get_current_dir_name() portability fix v2

Hopefully the correct version ... Not my day :(
Comment 4 David Bigagli 2014-09-25 10:55:33 MDT
Commited in cff3a1d66221c83.