From 5ed074df62fe13acd491079c2156907ba9e5b3be Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Mon, 10 Jun 2013 18:29:57 +0200 Subject: [PATCH] terminal-session: don't close session fd if already closed Prevents close(-1) from showing up in strace --- src/libply/ply-terminal-session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libply/ply-terminal-session.c b/src/libply/ply-terminal-session.c index e7377e9..0bdb985 100644 --- a/src/libply/ply-terminal-session.c +++ b/src/libply/ply-terminal-session.c @@ -148,7 +148,8 @@ ply_terminal_session_free (ply_terminal_session_t *session) ply_free_string_array (session->argv); - close (session->pseudoterminal_master_fd); + if (session->pseudoterminal_master_fd >= 0) + close (session->pseudoterminal_master_fd); free (session); } -- 1.8.1.4