[3/4] sk-unix: don't pass a negative value to close()

Submitted by Andrei Vagin on May 15, 2018, 10:55 p.m.

Details

Message ID 20180515225559.7309-3-avagin@virtuozzo.com
State Accepted
Series "Series without cover letter"
Headers show

Commit Message

Andrei Vagin May 15, 2018, 10:55 p.m.
CID 190174 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
6. negative_returns: fd is passed to a parameter that cannot be negative.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/sk-unix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index fd80a0b3d..ea314bb9f 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -216,7 +216,7 @@  int kerndat_socket_unix_file(void)
 		return 0;
 	}
 	close(sk);
-	close(fd);
+	close_safe(&fd);
 
 	kdat.sk_unix_file = true;