mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
arp: Preserve error if only the first ioctl fails
This commit is contained in:
parent
f7daf04f81
commit
203ee58aa2
1 changed files with 6 additions and 3 deletions
|
@ -156,11 +156,14 @@ int main(int argc, char** argv)
|
|||
|
||||
*(MACAddress*)&arp_req.arp_ha.sa_data[0] = hw_address.value();
|
||||
|
||||
int rc;
|
||||
int rc = 0;
|
||||
if (flag_set)
|
||||
rc = ioctl(fd, SIOCSARP, &arp_req);
|
||||
if (flag_delete)
|
||||
rc = ioctl(fd, SIOCDARP, &arp_req);
|
||||
if (flag_delete) {
|
||||
int rc2 = ioctl(fd, SIOCDARP, &arp_req);
|
||||
if (!rc2)
|
||||
rc = rc2;
|
||||
}
|
||||
|
||||
if (rc < 0) {
|
||||
perror("ioctl");
|
||||
|
|
Loading…
Add table
Reference in a new issue