#define CACHE_MASK (CACHE_SIZE - 1)
static int
-cache_and_print_inode_details(const unsigned long inode, char *const details)
+cache_inode_details(const unsigned long inode, char *const details)
{
cache_entry *e = &cache[inode & CACHE_MASK];
free(e->details);
e->inode = inode;
e->details = details;
- tprints(details);
return 1;
}
return false;
}
- return cache_and_print_inode_details(inode, details);
+ return cache_inode_details(inode, details);
}
static bool
const unsigned long inode, const char *proto_name)
{
return inet_send_query(fd, family, protocol)
- && receive_responses(fd, inode, proto_name, inet_parse_response);
+ && receive_responses(fd, inode, proto_name, inet_parse_response)
+ && print_sockaddr_by_inode_cached(inode);
}
static bool
peer_str, path_str) < 0)
return -1;
- return cache_and_print_inode_details(inode, details);
+ return cache_inode_details(inode, details);
}
static bool
return -1;
}
- return cache_and_print_inode_details(inode, details);
+ return cache_inode_details(inode, details);
}
static bool
unix_print(const int fd, const unsigned long inode)
{
return unix_send_query(fd, inode)
- && receive_responses(fd, inode, "UNIX", unix_parse_response);
+ && receive_responses(fd, inode, "UNIX", unix_parse_response)
+ && print_sockaddr_by_inode_cached(inode);
}
static bool
{
return netlink_send_query(fd, inode)
&& receive_responses(fd, inode, "NETLINK",
- netlink_parse_response);
+ netlink_parse_response)
+ && print_sockaddr_by_inode_cached(inode);
}
static const struct {