If sysconf(_SC_GETPW_R_SIZE_MAX) fails for any reason just use an initial
buffer size of 2048. This is not a critical failure, and the code that
makes use of this buffer is able to expand it later if required.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
buf_size = sysconf(_SC_GETPW_R_SIZE_MAX);
if (buf_size < 0) {
- LOGE(ERROR, "sysconf(_SC_GETPW_R_SIZE_MAX) returned error %ld",
- buf_size);
- return ERROR_FAIL;
+ buf_size = 2048;
+ LOG(DEBUG,
+"sysconf(_SC_GETPW_R_SIZE_MAX) failed, setting the initial buffer size to %ld",
+ buf_size);
}
while (1) {