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
4583dd9e
Commit
4583dd9e
authored
May 03, 2017
by
Vladislav Grishenko
Committed by
Simon Kelley
May 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace obsolete utime() usage with utimes().
This fixes build time warnings with POSIX.1-2008-aware c libraries.
parent
56144132
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
src/dnsmasq.c
src/dnsmasq.c
+1
-1
src/dnsmasq.h
src/dnsmasq.h
+0
-1
src/dnssec.c
src/dnssec.c
+7
-5
No files found.
src/dnsmasq.c
View file @
4583dd9e
...
@@ -1375,7 +1375,7 @@ static void async_event(int pipe, time_t now)
...
@@ -1375,7 +1375,7 @@ static void async_event(int pipe, time_t now)
/* update timestamp file on TERM if time is considered valid */
/* update timestamp file on TERM if time is considered valid */
if
(
daemon
->
back_to_the_future
)
if
(
daemon
->
back_to_the_future
)
{
{
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
==
-
1
)
if
(
utime
s
(
daemon
->
timestamp_file
,
NULL
)
==
-
1
)
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
}
}
#endif
#endif
...
...
src/dnsmasq.h
View file @
4583dd9e
...
@@ -117,7 +117,6 @@ typedef unsigned long long u64;
...
@@ -117,7 +117,6 @@ typedef unsigned long long u64;
#include <sys/uio.h>
#include <sys/uio.h>
#include <syslog.h>
#include <syslog.h>
#include <dirent.h>
#include <dirent.h>
#include <utime.h>
#ifndef HAVE_LINUX_NETWORK
#ifndef HAVE_LINUX_NETWORK
# include <net/if_dl.h>
# include <net/if_dl.h>
#endif
#endif
...
...
src/dnssec.c
View file @
4583dd9e
...
@@ -475,7 +475,7 @@ int setup_timestamp(void)
...
@@ -475,7 +475,7 @@ int setup_timestamp(void)
if
(
difftime
(
timestamp_time
,
time
(
0
))
<=
0
)
if
(
difftime
(
timestamp_time
,
time
(
0
))
<=
0
)
{
{
/* time already OK, update timestamp, and do key checking from the start. */
/* time already OK, update timestamp, and do key checking from the start. */
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
==
-
1
)
if
(
utime
s
(
daemon
->
timestamp_file
,
NULL
)
==
-
1
)
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
daemon
->
back_to_the_future
=
1
;
daemon
->
back_to_the_future
=
1
;
return
0
;
return
0
;
...
@@ -489,12 +489,14 @@ int setup_timestamp(void)
...
@@ -489,12 +489,14 @@ int setup_timestamp(void)
int
fd
=
open
(
daemon
->
timestamp_file
,
O_WRONLY
|
O_CREAT
|
O_NONBLOCK
|
O_EXCL
,
0666
);
int
fd
=
open
(
daemon
->
timestamp_file
,
O_WRONLY
|
O_CREAT
|
O_NONBLOCK
|
O_EXCL
,
0666
);
if
(
fd
!=
-
1
)
if
(
fd
!=
-
1
)
{
{
struct
utimbuf
timbuf
;
struct
timeval
tv
[
2
]
;
close
(
fd
);
close
(
fd
);
timestamp_time
=
timbuf
.
actime
=
timbuf
.
modtime
=
1420070400
;
/* 1-1-2015 */
timestamp_time
=
1420070400
;
/* 1-1-2015 */
if
(
utime
(
daemon
->
timestamp_file
,
&
timbuf
)
==
0
)
tv
[
0
].
tv_sec
=
tv
[
1
].
tv_sec
=
timestamp_time
;
tv
[
0
].
tv_usec
=
tv
[
1
].
tv_usec
=
0
;
if
(
utimes
(
daemon
->
timestamp_file
,
tv
)
==
0
)
goto
check_and_exit
;
goto
check_and_exit
;
}
}
}
}
...
@@ -519,7 +521,7 @@ static int check_date_range(u32 date_start, u32 date_end)
...
@@ -519,7 +521,7 @@ static int check_date_range(u32 date_start, u32 date_end)
{
{
if
(
daemon
->
back_to_the_future
==
0
&&
difftime
(
timestamp_time
,
curtime
)
<=
0
)
if
(
daemon
->
back_to_the_future
==
0
&&
difftime
(
timestamp_time
,
curtime
)
<=
0
)
{
{
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
!=
0
)
if
(
utime
s
(
daemon
->
timestamp_file
,
NULL
)
!=
0
)
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
my_syslog
(
LOG_INFO
,
_
(
"system time considered valid, now checking DNSSEC signature timestamps."
));
my_syslog
(
LOG_INFO
,
_
(
"system time considered valid, now checking DNSSEC signature timestamps."
));
...
...
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