On Mon, Mar 14, 2016 at 10:32:32AM +0100, Lukas Slebodnik wrote: > On (14/03/16 10:18), Jakub Hrozek wrote: > >On Mon, Mar 14, 2016 at 10:13:56AM +0100, Lukas Slebodnik wrote: > >> On (14/03/16 10:02), Jakub Hrozek wrote: > >> >On Mon, Mar 14, 2016 at 09:22:15AM +0100, Lukas Slebodnik wrote: > >> >> ehlo, > >> >> > >> >> attached patch fix coverity error. > >> >> > >> >> LS > >> > > >> >> From 26fc8459b84d90fa3f1ac35eb018257285f6a1d7 Mon Sep 17 00:00:00 2001 > >> >> From: Lukas Slebodnik <lsleb...@redhat.com> > >> >> Date: Mon, 14 Mar 2016 09:15:06 +0100 > >> >> Subject: [PATCH] UTIL: Do not call stderr with negative number > >> >> > >> >> The function connect return -1 in case of error > >> >> and we could call strerror with -1 instead of > >> >> errno. > >> >> --- > >> >> src/util/sss_sockets.c | 8 +++++--- > >> >> 1 file changed, 5 insertions(+), 3 deletions(-) > >> >> > >> >> diff --git a/src/util/sss_sockets.c b/src/util/sss_sockets.c > >> >> index > >> >> ae259fae4db1068d54487ebfa28d00c00eb6361f..4c870c7889c52ff6c1e7c8f6e73827e2a0d05d0a > >> >> 100644 > >> >> --- a/src/util/sss_sockets.c > >> >> +++ b/src/util/sss_sockets.c > >> >> @@ -180,9 +180,11 @@ static void sssd_async_connect_done(struct > >> >> tevent_context *ev, > >> >> errno = 0; > >> >> ret = connect(state->fd, (struct sockaddr *) &state->addr, > >> >> state->addr_len); > >> >> - if ((ret != EOK) && > >> >> - (errno == EALREADY || errno == EINPROGRESS || errno == EINTR)) > >> >> { > >> >> - return; /* Try again later */ > >> >> + if (ret != EOK) { > >> > > >> >Nitpick, but can you test against 0 and not EOK here? > >> > > >> man page says: > >> RETURN VALUE > >> If the connection or binding succeeds, zero is returned. On > >> error, -1 > >> is returned, and errno is set appropriately. > >> > >> Which way do you like more "ret != 0" or "ret == -1" > > > >I prefer to test for "not success". > BTW there was "ret != EOK" even before Simo's change :-) > > Updated patch is attached. > > LS
ACK _______________________________________________ sssd-devel mailing list sssd-devel@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/sssd-devel@lists.fedorahosted.org