comparison toys/other/ifconfig.c @ 1155:63f8c7fa94d7 draft

Ashwini sharma pointed out that show_help() doesn't exit so "ifconfig eth0 netmask" would segfault. Replace it with an error_exit(), see list for aesthetic issue this raises re: help text.
author Rob Landley <rob@landley.net>
date Sun, 22 Dec 2013 20:15:54 -0600
parents f8c926309a21
children f6f56a002d9a
comparison
equal deleted inserted replaced
1154:f7b777035025 1155:63f8c7fa94d7
476 } else if (strcmp(t->name, s)) continue; 476 } else if (strcmp(t->name, s)) continue;
477 477
478 // Is this an SIOCSI entry? 478 // Is this an SIOCSI entry?
479 if ((off|0xff) == 0x89ff) { 479 if ((off|0xff) == 0x89ff) {
480 if (!rev) { 480 if (!rev) {
481 if (!*++argv) show_help(); 481 if (!*++argv) error_exit("%s needs argument", t->name);
482 482
483 // Assign value to ifre field and call ioctl? (via IFREQ_OFFSZ.) 483 // Assign value to ifre field and call ioctl? (via IFREQ_OFFSZ.)
484 if (on < 0) { 484 if (on < 0) {
485 long l = strtoul(*argv, 0, 0); 485 long l = strtoul(*argv, 0, 0);
486 486