Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/rpc syslog an error if /etc/netconfig is not found....



details:   https://anonhg.NetBSD.org/src/rev/d919826c4330
branches:  trunk
changeset: 487697:d919826c4330
user:      assar <assar%NetBSD.org@localhost>
date:      Sun Jun 11 16:26:53 2000 +0000

description:
syslog an error if /etc/netconfig is not found.  fixes lib/10275

diffstat:

 lib/libc/rpc/getnetpath.c  |  6 +++++-
 lib/libc/rpc/rpc_generic.c |  5 ++++-
 lib/libc/rpc/rpcb_clnt.c   |  4 +++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diffs (92 lines):

diff -r 0430096be084 -r d919826c4330 lib/libc/rpc/getnetpath.c
--- a/lib/libc/rpc/getnetpath.c Sun Jun 11 15:37:51 2000 +0000
+++ b/lib/libc/rpc/getnetpath.c Sun Jun 11 16:26:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnetpath.c,v 1.1 2000/06/02 23:11:11 fvdl Exp $      */
+/*     $NetBSD: getnetpath.c,v 1.2 2000/06/11 16:26:53 assar Exp $     */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -46,6 +46,7 @@
 #include <netconfig.h>
 #include <stdlib.h>
 #include <string.h>
+#include <syslog.h>
 
 #ifdef __weak_alias
 __weak_alias(getnetpath,_getnetpath)
@@ -102,6 +103,7 @@
        return (NULL);
     }
     if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) {
+       syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
        return (NULL);
     }
     np_sessionp->valid = NP_VALID;
@@ -158,6 +160,8 @@
        do {                /* select next visible network */
            if (np_sessionp->nc_handlep == NULL) {
                np_sessionp->nc_handlep = setnetconfig();
+               if (np_sessionp->nc_handlep == NULL)
+                   syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
            }
            if ((ncp = getnetconfig(np_sessionp->nc_handlep)) == NULL) {
                return(NULL);
diff -r 0430096be084 -r d919826c4330 lib/libc/rpc/rpc_generic.c
--- a/lib/libc/rpc/rpc_generic.c        Sun Jun 11 15:37:51 2000 +0000
+++ b/lib/libc/rpc/rpc_generic.c        Sun Jun 11 16:26:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpc_generic.c,v 1.1 2000/06/02 23:11:13 fvdl Exp $     */
+/*     $NetBSD: rpc_generic.c,v 1.2 2000/06/11 16:26:53 assar Exp $    */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -53,6 +53,7 @@
 #include <netconfig.h>
 #include <malloc.h>
 #include <string.h>
+#include <syslog.h>
 #include <rpc/nettype.h>
 #include "rpc_com.h"
 
@@ -251,6 +252,7 @@
                void *confighandle;
 
                if (!(confighandle = setnetconfig())) {
+                       syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
                        return (NULL);
                }
                while ((nconf = getnetconfig(confighandle))) {
@@ -327,6 +329,7 @@
        case _RPC_TCP:
        case _RPC_UDP:
                if (!(handle->nhandle = setnetconfig())) {
+                       syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
                        free(handle);
                        return (NULL);
                }
diff -r 0430096be084 -r d919826c4330 lib/libc/rpc/rpcb_clnt.c
--- a/lib/libc/rpc/rpcb_clnt.c  Sun Jun 11 15:37:51 2000 +0000
+++ b/lib/libc/rpc/rpcb_clnt.c  Sun Jun 11 16:26:53 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpcb_clnt.c,v 1.2 2000/06/07 21:46:01 fvdl Exp $       */
+/*     $NetBSD: rpcb_clnt.c,v 1.3 2000/06/11 16:26:53 assar Exp $      */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -67,6 +67,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <netdb.h>
+#include <syslog.h>
 
 #include "rpc_com.h"
 
@@ -458,6 +459,7 @@
                nc_handle = setnetconfig();
                if (nc_handle == NULL) {
                        /* fails to open netconfig file */
+                       syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
                        rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
                        mutex_unlock(&loopnconf_lock);
                        return (NULL);



Home | Main Index | Thread Index | Old Index