diff options
Diffstat (limited to 'src/iwkey.c')
-rw-r--r-- | src/iwkey.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/iwkey.c b/src/iwkey.c index b4b44c5..a3403a8 100644 --- a/src/iwkey.c +++ b/src/iwkey.c @@ -24,6 +24,8 @@ #include <sys/ioctl.h> #include <errno.h> +#include <libdaemon/dlog.h> + #include "iwkey.h" #include "wireless.h" #include "util.h" @@ -35,7 +37,7 @@ int wep_key_add(struct interface *i, uint8_t w[WEP_KEY_LEN]) { assert(i); if (n_used_keys >= n_max_keys) { - fprintf(stderr, "Too many keys added!\n"); + daemon_log(LOG_ERR, "Too many keys added!\n"); return -1; } @@ -47,7 +49,7 @@ int wep_key_add(struct interface *i, uint8_t w[WEP_KEY_LEN]) { req.u.encoding.flags = key_map[n_used_keys++]+1; if (ioctl(i->fd, SIOCSIWENCODE, &req) < 0) { - fprintf(stderr, "ioctl(SIOCSIWENCODE): %s\n", strerror(errno)); + daemon_log(LOG_ERR, "ioctl(SIOCSIWENCODE): %s\n", strerror(errno)); return -1; } @@ -70,7 +72,7 @@ int wep_key_finish(struct interface *i) { req.u.encoding.flags = (key_map[n_used_keys-1]+1); if (ioctl(i->fd, SIOCGIWENCODE, &req) < 0) { - fprintf(stderr, "ioctl(SIOCGIWENCODE): %s\n", strerror(errno)); + daemon_log(LOG_ERR, "ioctl(SIOCGIWENCODE): %s\n", strerror(errno)); return -1; } @@ -83,7 +85,7 @@ int wep_key_finish(struct interface *i) { req.u.encoding.flags = (key_map[j]+1); if (ioctl(i->fd, SIOCSIWENCODE, &req) < 0) { - fprintf(stderr, "ioctl(SIOCSIWENCODE): %s\n", strerror(errno)); + daemon_log(LOG_ERR, "ioctl(SIOCSIWENCODE): %s\n", strerror(errno)); return -1; } } @@ -97,7 +99,7 @@ int wep_key_finish(struct interface *i) { req.u.encoding.flags = IW_ENCODE_RESTRICTED; if (ioctl(i->fd, SIOCSIWENCODE, &req) < 0) { - fprintf(stderr, "ioctl(SIOCSIWENCODE): %s\n", strerror(errno)); + daemon_log(LOG_ERR, "ioctl(SIOCSIWENCODE): %s\n", strerror(errno)); return -1; } |