Author: eugen
Date: Wed Aug  5 09:19:41 2020
New Revision: 363889
URL: https://svnweb.freebsd.org/changeset/base/363889

Log:
  bsnmptools: make it print protocol errors to stderr instead of stdout
  
  Reviewed by:          syrinx, bz
  MFC after:            1 week
  Differential Revision:        https://reviews.freebsd.org/D25911

Modified:
  head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c

Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==============================================================================
--- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c       Wed Aug  5 
09:16:35 2020        (r363888)
+++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c       Wed Aug  5 
09:19:41 2020        (r363889)
@@ -1828,11 +1828,11 @@ snmp_output_numval(struct snmp_toolinfo *snmptoolctx, 
                break;
 
            case SNMP_SYNTAX_NOSUCHOBJECT:
-               fprintf(stdout, "No Such Object\n");
+               fprintf(stderr, "No Such Object\n");
                return (val->syntax);
 
            case SNMP_SYNTAX_NOSUCHINSTANCE:
-               fprintf(stdout, "No Such Instance\n");
+               fprintf(stderr, "No Such Instance\n");
                return (val->syntax);
 
            case SNMP_SYNTAX_ENDOFMIBVIEW:
@@ -1841,12 +1841,12 @@ snmp_output_numval(struct snmp_toolinfo *snmptoolctx, 
 
            case SNMP_SYNTAX_NULL:
                /* NOTREACHED */
-               fprintf(stdout, "agent returned NULL Syntax\n");
+               fprintf(stderr, "agent returned NULL Syntax\n");
                return (val->syntax);
 
            default:
                /* NOTREACHED - If here - then all went completely wrong. */
-               fprintf(stdout, "agent returned unknown syntax\n");
+               fprintf(stderr, "agent returned unknown syntax\n");
                return (-1);
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to