dhcp: add systemd's sd-id128.c for sd_id128_get_machine()

This commit is contained in:
Thomas Haller 2015-02-02 10:27:55 +01:00
parent 887a1ab397
commit c140f4599d
3 changed files with 8 additions and 1 deletions

View file

@ -65,6 +65,7 @@ SYSTEMD_DHCP_CFLAGS = \
-I$(top_srcdir)/src/dhcp-manager/systemd-dhcp
libsystemd_dhcp_la_SOURCES = \
dhcp-manager/systemd-dhcp/src/libsystemd/sd-id128/sd-id128.c \
dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c \
dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c \
dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h \

View file

@ -19,6 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "nm-sd-adapt.h"
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@ -27,6 +29,7 @@
#include "macro.h"
#include "sd-id128.h"
#if 0 /* NM_IGNORED */
_public_ char *sd_id128_to_string(sd_id128_t id, char s[33]) {
unsigned n;
@ -102,6 +105,7 @@ static sd_id128_t make_v4_uuid(sd_id128_t id) {
return id;
}
#endif
_public_ int sd_id128_get_machine(sd_id128_t *ret) {
static thread_local sd_id128_t saved_machine_id;
@ -152,6 +156,7 @@ _public_ int sd_id128_get_machine(sd_id128_t *ret) {
return 0;
}
#if 0 /* NM_IGNORED */
_public_ int sd_id128_get_boot(sd_id128_t *ret) {
static thread_local sd_id128_t saved_boot_id;
static thread_local bool saved_boot_id_valid = false;
@ -227,3 +232,4 @@ _public_ int sd_id128_randomize(sd_id128_t *ret) {
*ret = make_v4_uuid(t);
return 0;
}
#endif /* NM_IGNORED */

View file

@ -410,7 +410,6 @@ do { \
_found; \
})
#if 0 /* NM_IGNORED */
/* Return a nulstr for a standard cascade of configuration directories,
* suitable to pass to conf_files_list_nulstr or config_parse_many. */
#define CONF_DIRS_NULSTR(n) \
@ -440,6 +439,7 @@ do { \
#endif
#endif
#if 0 /* NM_IGNORED */
/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
* compiler versions */
#ifndef noreturn