/*
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2017 Red Hat
SSSD's enhanced NSS API
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <time.h>
#include <errno.h>
#include "sss_cli.h"
#include "common_private.h"
extern struct sss_mutex sss_nss_mtx;
do { \
} \
} while (0)
{
int ret;
if (ret != 0) {
return ret;
}
return 0;
}
{
int ret;
int left;
/* make sure there is no overrun when calculating the time left */
if (timeout_ms > INT_MAX) {
}
if (ret != 0) {
return ret;
}
if (ret == 0) {
if (ret != 0) {
return ret;
}
if (timeout_ms == 0) {
*time_left_ms = 0;
} else {
if (left <= 0) {
return EIO;
} else if (left > SSS_CLI_SOCKET_TIMEOUT) {
} else {
*time_left_ms = left;
}
}
}
return ret;
}