mirror of
https://github.com/sheumann/hush.git
synced 2025-02-05 21:30:50 +00:00
libiproute: fix buggy open check: s/if (fd)/if (fd >= 0)/
less: small optimization -15 bytes
This commit is contained in:
parent
311c19a661
commit
12abcb36c8
@ -774,9 +774,7 @@ static void buffer_line(int linenum)
|
|||||||
static void open_file_and_read_lines(void)
|
static void open_file_and_read_lines(void)
|
||||||
{
|
{
|
||||||
if (filename) {
|
if (filename) {
|
||||||
int fd = xopen(filename, O_RDONLY);
|
xmove_fd(xopen(filename, O_RDONLY), STDIN_FILENO);
|
||||||
dup2(fd, 0);
|
|
||||||
if (fd) close(fd);
|
|
||||||
} else {
|
} else {
|
||||||
/* "less" with no arguments in argv[] */
|
/* "less" with no arguments in argv[] */
|
||||||
/* For status line only */
|
/* For status line only */
|
||||||
|
@ -172,7 +172,7 @@ int xll_name_to_index(const char *const name)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
|
sock_fd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||||
if (sock_fd) {
|
if (sock_fd >= 0) {
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
int tmp;
|
int tmp;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user