Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
395eb719
Commit
395eb719
authored
Jul 06, 2012
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better log message when dhcp hosts|opts file cannot be read.
parent
6b617c0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
src/option.c
src/option.c
+11
-10
No files found.
src/option.c
View file @
395eb719
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
static
volatile
int
mem_recover
=
0
;
static
volatile
int
mem_recover
=
0
;
static
jmp_buf
mem_jmp
;
static
jmp_buf
mem_jmp
;
static
void
one_file
(
char
*
file
,
int
hard_opt
);
static
int
one_file
(
char
*
file
,
int
hard_opt
);
/* Solaris headers don't have facility names. */
/* Solaris headers don't have facility names. */
#ifdef HAVE_SOLARIS_NETWORK
#ifdef HAVE_SOLARIS_NETWORK
...
@@ -3289,7 +3289,7 @@ static void read_file(char *file, FILE *f, int hard_opt)
...
@@ -3289,7 +3289,7 @@ static void read_file(char *file, FILE *f, int hard_opt)
fclose
(
f
);
fclose
(
f
);
}
}
static
void
one_file
(
char
*
file
,
int
hard_opt
)
static
int
one_file
(
char
*
file
,
int
hard_opt
)
{
{
FILE
*
f
;
FILE
*
f
;
int
nofile_ok
=
0
;
int
nofile_ok
=
0
;
...
@@ -3310,7 +3310,7 @@ static void one_file(char *file, int hard_opt)
...
@@ -3310,7 +3310,7 @@ static void one_file(char *file, int hard_opt)
if
(
hard_opt
==
0
&&
strcmp
(
file
,
"-"
)
==
0
)
if
(
hard_opt
==
0
&&
strcmp
(
file
,
"-"
)
==
0
)
{
{
if
(
read_stdin
==
1
)
if
(
read_stdin
==
1
)
return
;
return
1
;
read_stdin
=
1
;
read_stdin
=
1
;
file
=
"stdin"
;
file
=
"stdin"
;
f
=
stdin
;
f
=
stdin
;
...
@@ -3326,7 +3326,7 @@ static void one_file(char *file, int hard_opt)
...
@@ -3326,7 +3326,7 @@ static void one_file(char *file, int hard_opt)
for
(
r
=
filesread
;
r
;
r
=
r
->
next
)
for
(
r
=
filesread
;
r
;
r
=
r
->
next
)
if
(
r
->
dev
==
statbuf
.
st_dev
&&
r
->
ino
==
statbuf
.
st_ino
)
if
(
r
->
dev
==
statbuf
.
st_dev
&&
r
->
ino
==
statbuf
.
st_ino
)
return
;
return
1
;
r
=
safe_malloc
(
sizeof
(
struct
fileread
));
r
=
safe_malloc
(
sizeof
(
struct
fileread
));
r
->
next
=
filesread
;
r
->
next
=
filesread
;
...
@@ -3338,14 +3338,14 @@ static void one_file(char *file, int hard_opt)
...
@@ -3338,14 +3338,14 @@ static void one_file(char *file, int hard_opt)
if
(
!
(
f
=
fopen
(
file
,
"r"
)))
if
(
!
(
f
=
fopen
(
file
,
"r"
)))
{
{
if
(
errno
==
ENOENT
&&
nofile_ok
)
if
(
errno
==
ENOENT
&&
nofile_ok
)
return
;
/* No conffile, all done. */
return
1
;
/* No conffile, all done. */
else
else
{
{
char
*
str
=
_
(
"cannot read %s: %s"
);
char
*
str
=
_
(
"cannot read %s: %s"
);
if
(
hard_opt
!=
0
)
if
(
hard_opt
!=
0
)
{
{
my_syslog
(
LOG_ERR
,
str
,
file
,
strerror
(
errno
));
my_syslog
(
LOG_ERR
,
str
,
file
,
strerror
(
errno
));
return
;
return
0
;
}
}
else
else
die
(
str
,
file
,
EC_FILE
);
die
(
str
,
file
,
EC_FILE
);
...
@@ -3354,6 +3354,7 @@ static void one_file(char *file, int hard_opt)
...
@@ -3354,6 +3354,7 @@ static void one_file(char *file, int hard_opt)
}
}
read_file
(
file
,
f
,
hard_opt
);
read_file
(
file
,
f
,
hard_opt
);
return
1
;
}
}
/* expand any name which is a directory */
/* expand any name which is a directory */
...
@@ -3506,8 +3507,8 @@ void reread_dhcp(void)
...
@@ -3506,8 +3507,8 @@ void reread_dhcp(void)
for
(
hf
=
daemon
->
dhcp_hosts_file
;
hf
;
hf
=
hf
->
next
)
for
(
hf
=
daemon
->
dhcp_hosts_file
;
hf
;
hf
=
hf
->
next
)
if
(
!
(
hf
->
flags
&
AH_INACTIVE
))
if
(
!
(
hf
->
flags
&
AH_INACTIVE
))
{
{
one_file
(
hf
->
fname
,
LOPT_BANK
);
if
(
one_file
(
hf
->
fname
,
LOPT_BANK
))
my_syslog
(
MS_DHCP
|
LOG_INFO
,
_
(
"read %s"
),
hf
->
fname
);
my_syslog
(
MS_DHCP
|
LOG_INFO
,
_
(
"read %s"
),
hf
->
fname
);
}
}
}
}
...
@@ -3542,8 +3543,8 @@ void reread_dhcp(void)
...
@@ -3542,8 +3543,8 @@ void reread_dhcp(void)
for
(
hf
=
daemon
->
dhcp_opts_file
;
hf
;
hf
=
hf
->
next
)
for
(
hf
=
daemon
->
dhcp_opts_file
;
hf
;
hf
=
hf
->
next
)
if
(
!
(
hf
->
flags
&
AH_INACTIVE
))
if
(
!
(
hf
->
flags
&
AH_INACTIVE
))
{
{
one_file
(
hf
->
fname
,
LOPT_OPTS
);
if
(
one_file
(
hf
->
fname
,
LOPT_OPTS
))
my_syslog
(
MS_DHCP
|
LOG_INFO
,
_
(
"read %s"
),
hf
->
fname
);
my_syslog
(
MS_DHCP
|
LOG_INFO
,
_
(
"read %s"
),
hf
->
fname
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment