summaryrefslogtreecommitdiffstats
path: root/src/waproamd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/waproamd.c')
-rw-r--r--src/waproamd.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/waproamd.c b/src/waproamd.c
index 430c839..7c8d7d8 100644
--- a/src/waproamd.c
+++ b/src/waproamd.c
@@ -64,7 +64,7 @@ char log_ident[32], pid_ident[32];
int issue_scan(struct interface *i) {
- //fprintf(stderr, "Scanning...\n");
+ //daemon_log(LOG_ERR, "Scanning...\n");
if (iw_set_mode(i, IW_MODE_INFRA) < 0)
return -1;
@@ -167,16 +167,13 @@ int set_current_ap(struct hw_addr *a) {
setenv("IFACE", interface_name, 1);
if (!hw_addr_equal(&current_ap, &null_ap)) {
- fprintf(stderr, "Selected AP ");
- print_hw_addr(stderr, &current_ap);
- fprintf(stderr, "\n");
+ daemon_log(LOG_INFO, "Selected new AP %s", t);
if (run_script(&current_ap, "start") < 0)
return -1;
}
}
-
return 0;
}
@@ -319,7 +316,7 @@ int go(struct interface *i) {
if (errno == EINTR)
continue;
- fprintf(stderr, "select() failed: %s\n", strerror(errno));
+ daemon_log(LOG_ERR, "select() failed: %s\n", strerror(errno));
goto finish;
}
@@ -341,7 +338,7 @@ int go(struct interface *i) {
/* Changed: enabled -> disabled */
if (!d && disabled) {
- fprintf(stderr, "Interface disabled\n");
+ daemon_log(LOG_INFO, "Interface disabled\n");
if (associated)
if (set_current_ap(&null_ap) < 0)
@@ -352,21 +349,21 @@ int go(struct interface *i) {
/* Changed: disabled -> enabled */
if (d && !disabled) {
- fprintf(stderr, "Interface enabled\n");
+ daemon_log(LOG_INFO, "Interface enabled\n");
associated = 0;
}
if (!disabled) {
/* Changed: associated -> not associated */
if (a && !associated)
- fprintf(stderr, "No longer associated.\n");
+ daemon_log(LOG_INFO, "No longer associated.\n");
/* Changed: not associated -> associated */
if (!a && associated) {
if (set_current_ap(&associated_ap) < 0)
goto finish;
- fprintf(stderr, "Associated.\n");
+ daemon_log(LOG_INFO, "Associated.\n");
next_scan = (time_t) -1;
}
@@ -559,7 +556,7 @@ void parse_args(int argc, char *argv[]) {
break;
default:
- fprintf(stderr, "Unknown parameter.\n");
+ daemon_log(LOG_ERR, "Unknown parameter.\n");
exit(1);
}
}