diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-31 18:57:37 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-12-31 18:57:37 +0000 |
commit | 98ee06d3d46aa7f89c204681c7075b53300a6a6e (patch) | |
tree | 0f5cafbb22cd83fb73e024acba658c7a51582951 /networking/libiproute/iplink.c | |
parent | 806116b23407bdf95f22646f11f50b1d14e1cfc2 (diff) |
stop using __u32 etc. uint32_t is there for a reason
Diffstat (limited to 'networking/libiproute/iplink.c')
-rw-r--r-- | networking/libiproute/iplink.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index ea57d60ac..ae41ab308 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c @@ -47,11 +47,11 @@ static int get_ctl_fd(void) if (fd >= 0) return fd; errno = s_errno; - perror("Cannot create control socket"); + bb_perror_msg("cannot create control socket"); return -1; } -static int do_chflags(char *dev, __u32 flags, __u32 mask) +static int do_chflags(char *dev, uint32_t flags, uint32_t mask) { struct ifreq ifr; int fd; @@ -63,7 +63,7 @@ static int do_chflags(char *dev, __u32 flags, __u32 mask) return -1; err = ioctl(fd, SIOCGIFFLAGS, &ifr); if (err) { - perror("SIOCGIFFLAGS"); + bb_perror_msg("SIOCGIFFLAGS"); close(fd); return -1; } @@ -72,7 +72,7 @@ static int do_chflags(char *dev, __u32 flags, __u32 mask) ifr.ifr_flags |= mask&flags; err = ioctl(fd, SIOCSIFFLAGS, &ifr); if (err) - perror("SIOCSIFFLAGS"); + bb_perror_msg("SIOCSIFFLAGS"); } close(fd); return err; @@ -91,7 +91,7 @@ static int do_changename(char *dev, char *newdev) return -1; err = ioctl(fd, SIOCSIFNAME, &ifr); if (err) { - perror("SIOCSIFNAME"); + bb_perror_msg("SIOCSIFNAME"); close(fd); return -1; } @@ -112,7 +112,7 @@ static int set_qlen(char *dev, int qlen) strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)); ifr.ifr_qlen = qlen; if (ioctl(s, SIOCSIFTXQLEN, &ifr) < 0) { - perror("SIOCSIFXQLEN"); + bb_perror_msg("SIOCSIFXQLEN"); close(s); return -1; } @@ -134,7 +134,7 @@ static int set_mtu(char *dev, int mtu) strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)); ifr.ifr_mtu = mtu; if (ioctl(s, SIOCSIFMTU, &ifr) < 0) { - perror("SIOCSIFMTU"); + bb_perror_msg("SIOCSIFMTU"); close(s); return -1; } @@ -152,14 +152,14 @@ static int get_address(char *dev, int *htype) s = socket(PF_PACKET, SOCK_DGRAM, 0); if (s < 0) { - perror("socket(PF_PACKET)"); + bb_perror_msg("socket(PF_PACKET)"); return -1; } memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) { - perror("SIOCGIFINDEX"); + bb_perror_msg("SIOCGIFINDEX"); close(s); return -1; } @@ -169,14 +169,14 @@ static int get_address(char *dev, int *htype) me.sll_ifindex = ifr.ifr_ifindex; me.sll_protocol = htons(ETH_P_LOOP); if (bind(s, (struct sockaddr*)&me, sizeof(me)) == -1) { - perror("bind"); + bb_perror_msg("bind"); close(s); return -1; } alen = sizeof(me); if (getsockname(s, (struct sockaddr*)&me, &alen) == -1) { - perror("getsockname"); + bb_perror_msg("getsockname"); close(s); return -1; } @@ -210,7 +210,7 @@ static int set_address(struct ifreq *ifr, int brd) if (s < 0) return -1; if (ioctl(s, brd?SIOCSIFHWBROADCAST:SIOCSIFHWADDR, ifr) < 0) { - perror(brd?"SIOCSIFHWBROADCAST":"SIOCSIFHWADDR"); + bb_perror_msg(brd ? "SIOCSIFHWBROADCAST" : "SIOCSIFHWADDR"); close(s); return -1; } @@ -222,8 +222,8 @@ static int set_address(struct ifreq *ifr, int brd) static int do_set(int argc, char **argv) { char *dev = NULL; - __u32 mask = 0; - __u32 flags = 0; + uint32_t mask = 0; + uint32_t flags = 0; int qlen = -1; int mtu = -1; char *newaddr = NULL; |