{
tInterface *ifaces = NULL, *i;
- // TODO: Scan /Devices and search for network adapters
if( argc > 2 ) {
fprintf(stderr, "Usage: %s <interface>\n", argv[0]);
return -1;
if(maxfd < i->SocketFD) maxfd = i->SocketFD;
}
- if( select(maxfd+1, &fds, NULL, NULL, &timeout) < 0 )
+ if( _SysSelect(maxfd+1, &fds, NULL, NULL, &timeout, 0) < 0 )
{
- // TODO: Check error result
+ perror("_SysSelect returned error");
return -1;
}
sprintf(path, "/Devices/ip/adapters/%s", Iface->Adapter);
fd = _SysOpen(path, 0);
if(fd == -1) {
+ perror("Opening adapter");
_SysDebug("Unable to open adapter %s", path);
return -1;
}
- _SysIOCtl(fd, 4, Iface->HWAddr);
- // TODO: Check if ioctl() failed
+ if( _SysIOCtl(fd, 4, Iface->HWAddr) ) {
+ perror("Getting MAC address");
+ return -1;
+ }
_SysClose(fd);
}
switch( *Buf )
{
case '\b':
- // TODO: Backspace
Display_MoveCursor(-1, 0);
Display_AddText(1, " ");
Display_MoveCursor(-1, 0);
+ // TODO: Need to handle \t and ^A-Z
return 1;
case '\t':
// TODO: tab (get current cursor pos, space until multiple of 8)
Display_Newline(1);
return 1;
case '\r':
- // TODO: Carriage return
Display_MoveCursor(INT_MIN, 0);
return 1;
}
{
if( args[i] < 8 )
{
- // Flags?
+ // TODO: Flags?
}
else if( 30 <= args[i] && args[i] <= 37 )
{