Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opienet/onetwork.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index be45924..918ba07 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -58,6 +58,11 @@ | |||
58 | 58 | ||
59 | using namespace std; | 59 | using namespace std; |
60 | 60 | ||
61 | #ifndef NODEBUG | ||
62 | #include <opie2/oioctlmap.h> | ||
63 | IntStringMap* _ioctlmap = constructIoctlMap(); | ||
64 | #endif | ||
65 | |||
61 | /*====================================================================================== | 66 | /*====================================================================================== |
62 | * ONetwork | 67 | * ONetwork |
63 | *======================================================================================*/ | 68 | *======================================================================================*/ |
@@ -187,12 +192,16 @@ void ONetworkInterface::init() | |||
187 | 192 | ||
188 | bool ONetworkInterface::ioctl( int call, struct ifreq& ifreq ) const | 193 | bool ONetworkInterface::ioctl( int call, struct ifreq& ifreq ) const |
189 | { | 194 | { |
195 | #ifndef NODEBUG | ||
190 | int result = ::ioctl( _sfd, call, &ifreq ); | 196 | int result = ::ioctl( _sfd, call, &ifreq ); |
191 | if ( result == -1 ) | 197 | if ( result == -1 ) |
192 | qDebug( "ONetworkInterface::ioctl (%s) call %d (0x%04X) - Status: Failed: %d (%s)", name(), call, call, result, strerror( errno ) ); | 198 | qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) *(*_ioctlmap)[call], call, result, strerror( errno ) ); |
193 | else | 199 | else |
194 | qDebug( "ONetworkInterface::ioctl (%s) call %d (0x%04X) - Status: Ok.", name(), call, call ); | 200 | qDebug( "ONetworkInterface::ioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) *(*_ioctlmap)[call], call ); |
195 | return ( result != -1 ); | 201 | return ( result != -1 ); |
202 | #else | ||
203 | return ::ioctl( _sfd, call, &ifreq ) != -1; | ||
204 | #endif | ||
196 | } | 205 | } |
197 | 206 | ||
198 | 207 | ||
@@ -883,12 +892,16 @@ int OWirelessNetworkInterface::scanNetwork() | |||
883 | 892 | ||
884 | bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const | 893 | bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const |
885 | { | 894 | { |
895 | #ifndef NODEBUG | ||
886 | int result = ::ioctl( _sfd, call, &iwreq ); | 896 | int result = ::ioctl( _sfd, call, &iwreq ); |
887 | if ( result == -1 ) | 897 | if ( result == -1 ) |
888 | qDebug( "ONetworkInterface::wioctl (%s) call %d (0x%04X) - Status: Failed: %d (%s)", name(), call, call, result, strerror( errno ) ); | 898 | qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Failed: %d (%s)", name(), (const char*) *(*_ioctlmap)[call], call, result, strerror( errno ) ); |
889 | else | 899 | else |
890 | qDebug( "ONetworkInterface::wioctl (%s) call %d (0x%04X) - Status: Ok.", name(), call, call ); | 900 | qDebug( "ONetworkInterface::wioctl (%s) call %s (0x%04X) - Status: Ok.", name(), (const char*) *(*_ioctlmap)[call], call ); |
891 | return ( result != -1 ); | 901 | return ( result != -1 ); |
902 | #else | ||
903 | return ::ioctl( _sfd, call, &iwreq ) != -1; | ||
904 | #endif | ||
892 | } | 905 | } |
893 | 906 | ||
894 | 907 | ||