8850 libresolv2: variable 'tvp' set but not used

Review Request #776 — Created Nov. 21, 2017 and submitted

tsoome
illumos-gate
8850
a77732d...
general
../common/isc/eventlib.c: In function 'Pselect':
../common/isc/eventlib.c:740:22: error: variable 'tvp' set but not used [-Werror=unused-but-set-variable]
  struct timeval tv, *tvp;
                      ^~~
cc1: all warnings being treated as errors


yuripv
  1. Ship It!
  2. 
      
jgmills
  1. I believe you have to leave the `tvp = NULL' in there.  Here's part of the diff I used:
    
     	if (tsp) {
    +#ifndef USE_POLL
     		tvp = &tv;
    +#endif
     		tv = evTimeVal(*tsp);
     #ifdef USE_POLL
     		polltimeout = 1000 * tv.tv_sec + tv.tv_usec / 1000;
     #endif /* USE_POLL */
    -	} else
    +	}
    +#ifndef USE_POLL
    +	  else
     		tvp = NULL;
    +#endif
     	if (sigmask)
    1. I did move its initialization to NULL above, to the declaration, and got the same result except with a bit less spaghetti:)

    2. Okay, I'm satisfied.

  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...