don't perror just because the .netrc file isn't there
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Mon, 11 Oct 1982 08:24:19 +0000 (00:24 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Mon, 11 Oct 1982 08:24:19 +0000 (00:24 -0800)
SCCS-vsn: lib/libcompat/4.3/ruserpass.c 4.2

usr/src/lib/libcompat/4.3/ruserpass.c

index 9c65c2d..c7786ca 100644 (file)
@@ -7,6 +7,7 @@ static char sccsid[] = "@(#)ruserpass.c 4.2 %G%";
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <errno.h>
 
 char   *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin();
 struct utmp *getutmp();
 
 char   *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin();
 struct utmp *getutmp();
@@ -128,6 +129,7 @@ rnetrc(host, aname, apass)
        char *hdir, buf[BUFSIZ];
        int t;
        struct stat stb;
        char *hdir, buf[BUFSIZ];
        int t;
        struct stat stb;
+       extern int errno;
 
        hdir = getenv("HOME");
        if (hdir == NULL)
 
        hdir = getenv("HOME");
        if (hdir == NULL)
@@ -135,7 +137,8 @@ rnetrc(host, aname, apass)
        sprintf(buf, "%s/.netrc", hdir);
        cfile = fopen(buf, "r");
        if (cfile == NULL) {
        sprintf(buf, "%s/.netrc", hdir);
        cfile = fopen(buf, "r");
        if (cfile == NULL) {
-               perror(buf);
+               if (errno != ENOENT)
+                       perror(buf);
                return;
        }
 next:
                return;
        }
 next: