Skip to content

Commit

Permalink
Downgrade ignored errors to warnings.
Browse files Browse the repository at this point in the history
If the error is ignored it is not important enough - make it a warning
instead.

Signed-off-by: Michał Mirosław <[email protected]>
  • Loading branch information
Mian Luo authored and osctobe committed Jun 19, 2023
1 parent a7ec13e commit e35094f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions criu/include/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ void flush_early_log_buffer(int fd);

#define pr_perror(fmt, ...) pr_err(fmt ": %s\n", ##__VA_ARGS__, strerror(errno))

#define pr_pwarn(fmt, ...) pr_warn(fmt ": %s\n", ##__VA_ARGS__, strerror(errno))

#endif /* CR_NOGLIBC */

#endif /* __CR_LOG_H__ */
4 changes: 2 additions & 2 deletions criu/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1076,14 +1076,14 @@ void tcp_cork(int sk, bool on)
{
int val = on ? 1 : 0;
if (setsockopt(sk, SOL_TCP, TCP_CORK, &val, sizeof(val)))
pr_perror("Unable to restore TCP_CORK (%d)", val);
pr_pwarn("Unable to restore TCP_CORK (%d)", val);
}

void tcp_nodelay(int sk, bool on)
{
int val = on ? 1 : 0;
if (setsockopt(sk, SOL_TCP, TCP_NODELAY, &val, sizeof(val)))
pr_perror("Unable to restore TCP_NODELAY (%d)", val);
pr_pwarn("Unable to restore TCP_NODELAY (%d)", val);
}

static int get_sockaddr_in(struct sockaddr_storage *addr, char *host, unsigned short port)
Expand Down

0 comments on commit e35094f

Please sign in to comment.