Coverity complains about resource leak after open when fd gets 0 with below
warning.
off_by_one: Testing whether handle tfd is strictly greater than zero is
suspicious. tfd leaks when it is zero.
It is right. 0 is a valid fd. -1 is not.
Change-Id: I22c2eb75b99bb6209921b9f874190cbbdf10e6ce
Signed-off-by: Steven Luong <sluong@cisco.com>
while (nanosleep (&ts, &tsrem) < 0)
ts = tsrem;
tfd = open ((char *) api_name, O_RDWR);
- if (tfd > 0)
+ if (tfd >= 0)
break;
}
vec_free (api_name);