Date: Mon, 12 Jun 2017 20:14:44 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319868 - in head/sys: kern sys Message-ID: <201706122014.v5CKEitK071089@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Jun 12 20:14:44 2017 New Revision: 319868 URL: https://svnweb.freebsd.org/changeset/base/319868 Log: Add a helper function for comparing struct uuids. Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11138 Modified: head/sys/kern/kern_uuid.c head/sys/sys/uuid.h Modified: head/sys/kern/kern_uuid.c ============================================================================== --- head/sys/kern/kern_uuid.c Mon Jun 12 19:54:42 2017 (r319867) +++ head/sys/kern/kern_uuid.c Mon Jun 12 20:14:44 2017 (r319868) @@ -424,3 +424,10 @@ parse_uuid(const char *str, struct uuid *uuid) (c[3] & 0xc0) != 0x80 && /* variant 1? */ (c[3] & 0xe0) != 0xc0) ? EINVAL : 0); /* variant 2? */ } + +int +uuidcmp(const struct uuid *uuid1, const struct uuid *uuid2) +{ + + return (memcmp(uuid1, uuid2, sizeof(struct uuid))); +} Modified: head/sys/sys/uuid.h ============================================================================== --- head/sys/sys/uuid.h Mon Jun 12 19:54:42 2017 (r319867) +++ head/sys/sys/uuid.h Mon Jun 12 20:14:44 2017 (r319868) @@ -65,6 +65,7 @@ int snprintf_uuid(char *, size_t, struct uuid *); int printf_uuid(struct uuid *); int sbuf_printf_uuid(struct sbuf *, struct uuid *); int parse_uuid(const char *, struct uuid *); +int uuidcmp(const struct uuid *, const struct uuid *); void be_uuid_dec(void const *buf, struct uuid *uuid); void be_uuid_enc(void *buf, struct uuid const *uuid);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706122014.v5CKEitK071089>