projects
/
project
/
mdnsd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set errno when refusing to send packet in interface_send_packet
[project/mdnsd.git]
/
util.c
diff --git
a/util.c
b/util.c
index e68e9c9f5f0e27cbbc2f02382698475bb867dff0..63f1612fdb2c935887de2d0bdd2953ae5d630a40 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-16,8
+16,6
@@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/utsname.h>
-#include <linux/if.h>
-#include <linux/sockios.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <unistd.h>
@@
-29,6
+27,7
@@
#include <signal.h>
#include <libubox/uloop.h>
#include <signal.h>
#include <libubox/uloop.h>
+#include <libubox/utils.h>
#include "dns.h"
#include "util.h"
#include "dns.h"
#include "util.h"
@@
-76,13
+75,9
@@
void get_hostname(void)
snprintf(mdns_hostname_local, sizeof(mdns_hostname_local), "%s.local", utsname.nodename);
}
snprintf(mdns_hostname_local, sizeof(mdns_hostname_local), "%s.local", utsname.nodename);
}
-void*
-memdup(const void *d, int l)
+time_t monotonic_time(void)
{
{
- void *r = malloc(l);
- if (!r)
- return NULL;
- memcpy(r, d, l);
- return r;
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return ts.tv_sec;
}
}
-