X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Foptions.c;h=f9c9aa56e243d5d091e383348b5ad4c025e3f5ef;hb=8821c36a7798fd1c16d85ce63bcf519618975800;hp=2418d28642a71167175fa421b169acc4648720d2;hpb=c1d7b083dc15423cae75be3c8b50a9a35aceac21;p=ppp.git diff --git a/pppd/options.c b/pppd/options.c index 2418d28..f9c9aa5 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: options.c,v 1.56 1999/03/30 06:33:08 paulus Exp $"; +static char rcsid[] = "$Id: options.c,v 1.57 1999/04/12 06:24:47 paulus Exp $"; #endif #include @@ -347,7 +347,7 @@ options_from_file(filename, must_exist, check_prot, priv) int priv; { FILE *f; - int i, newline, ret; + int i, newline, ret, err; option_t *opt; int oldpriv; char *oldsource; @@ -358,11 +358,13 @@ options_from_file(filename, must_exist, check_prot, priv) if (check_prot) seteuid(getuid()); f = fopen(filename, "r"); + err = errno; if (check_prot) seteuid(0); if (f == NULL) { - if (!must_exist && errno == ENOENT) + if (!must_exist && err == ENOENT) return 1; + errno = err; option_error("Can't open options file %s: %m", filename); return 0; }