From 09dbef88bfc4286615dc436ced85f629179f857a Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Mon, 16 Dec 2024 22:00:00 +0000
Subject: [PATCH] (ftpfs.c) fix error handling
Assuming that 'close' is successful; 'errno' becomes undefined after the call
Found by Clang-19 Static Analyzer
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/vfs/ftpfs/ftpfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/vfs/ftpfs/ftpfs.c b/src/vfs/ftpfs/ftpfs.c
index 6eb9c2aaf..1240160ba 100644
a
|
b
|
ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super) |
933 | 933 | break; |
934 | 934 | |
935 | 935 | me->verrno = errno; |
936 | | close (my_socket); |
| 936 | e = close (my_socket); |
937 | 937 | |
938 | | if (errno == EINTR && tty_got_interrupt ()) |
| 938 | if (e < 0 && errno == EINTR && tty_got_interrupt ()) |
939 | 939 | vfs_print_message ("%s", _("ftpfs: connection interrupted by user")); |
940 | 940 | else if (res->ai_next == NULL) |
941 | 941 | vfs_print_message (_("ftpfs: connection to server failed: %s"), |