Just in case, and for the sake of consistency with setvar_string().

Signed-off-by: Michal Soltys <[email protected]>
---
 drivers/apcsmart.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/apcsmart.c b/drivers/apcsmart.c
index 63b91b5..70aebfc 100644
--- a/drivers/apcsmart.c
+++ b/drivers/apcsmart.c
@@ -1141,6 +1141,7 @@ static int setvar_enum(apc_vartab_t *vt, const char *val)
        char    orig[256], temp[256];
        const char      *ptr;
 
+       ser_flush_in(upsfd, IGNCHARS, nut_debug_level);
        ret = ser_send_char(upsfd, vt->cmd);
 
        if (ret != 1) {
@@ -1235,7 +1236,6 @@ static int setvar_string(apc_vartab_t *vt, const char 
*val)
        char    temp[256];
 
        ser_flush_in(upsfd, IGNCHARS, nut_debug_level);
-
        ret = ser_send_char(upsfd, vt->cmd);
 
        if (ret != 1) {
@@ -1338,6 +1338,7 @@ static int do_cmd(apc_cmdtab_t *ct)
        int     ret;
        char    buf[SMALLBUF];
 
+       ser_flush_in(upsfd, IGNCHARS, nut_debug_level);
        ret = ser_send_char(upsfd, ct->cmd);
 
        if (ret != 1) {
-- 
1.7.2.1


_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev

Reply via email to