Skip to content

Commit

Permalink
sk-inet: Extend 'TCP repair off' failure log.
Browse files Browse the repository at this point in the history
Include the file descriptor and error code in the debug message to make
it more useful.

Fixes: e7ba909 (2016-03-14 "cr-check: Inspect errno on syscall failures")
Change-Id: I8e5e4953f0231ed935ef3dbbab800080e4ee549f
Signed-off-by: Michał Mirosław <emmir@google.com>
  • Loading branch information
osctobe committed Jul 24, 2023
1 parent 53dd6ba commit 5551201
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion criu/include/sk-inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ extern int inet_connect(int sk, struct inet_sk_info *);

#ifdef CR_NOGLIBC
#define setsockopt sys_setsockopt
#define pr_perror(fmt, ...) pr_err(fmt ": errno %d\n", ##__VA_ARGS__, -ret)
#endif
static inline void tcp_repair_off(int fd)
{
int aux = 0, ret;

ret = setsockopt(fd, SOL_TCP, TCP_REPAIR, &aux, sizeof(aux));
if (ret < 0)
pr_err("Failed to turn off repair mode on socket\n");
pr_perror("Failed to turn off repair mode on socket %d", fd);
}

extern void tcp_locked_conn_add(struct inet_sk_info *);
Expand Down

0 comments on commit 5551201

Please sign in to comment.