After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743072 - Support *BSD uuid functions
Support *BSD uuid functions
Status: RESOLVED FIXED
Product: GUPnP
Classification: Other
Component: gupnp
0.20.x
Other NetBSD
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-17 09:41 UTC by Thomas Klausner
Modified: 2015-04-06 11:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Compilation fix on *BSD without libuuid. (975 bytes, patch)
2015-01-17 09:41 UTC, Thomas Klausner
needs-work Details | Review
Adapted patch, as requested. (1010 bytes, patch)
2015-01-19 12:45 UTC, Thomas Klausner
none Details | Review
Add more error handling (1.31 KB, patch)
2015-01-25 07:44 UTC, Thomas Klausner
none Details | Review
Use GUUL for native UUID support (9.45 KB, patch)
2015-04-06 11:45 UTC, Jens Georg
none Details | Review
Use GUUL for native UUID support (9.45 KB, patch)
2015-04-06 11:49 UTC, Jens Georg
none Details | Review

Description Thomas Klausner 2015-01-17 09:41:12 UTC
Created attachment 294730 [details] [review]
Compilation fix on *BSD without libuuid.

Most BSDs have uuid functions in their standard C library with a different API than Linux' libuuid; see e.g. here for the NetBSD versions of these functions:

http://netbsd.gw.com/cgi-bin/man-cgi?uuid_compare++NetBSD-current

The attached patch adds support for these functions to libgupnp.
Additionally, the configure script needs to be taught to be happy if it finds e.g. uuid_create(), and not insist on linking against libuuid in that case.
Comment 1 Jens Georg 2015-01-19 09:03:33 UTC
Review of attachment 294730 [details] [review]:

Minor issues; I can fix them after committing if you don't want to do it

::: libgupnp/gupnp-service.c.orig
@@ +1110,1 @@
 

you could enclose the whole section in { } and use #ifdef on that to have only one ifdef

@@ +1113,3 @@
+	uuid_to_string(&id, &myout, 0);
+	strncpy(out, myout, sizeof(out));
+	free(myout);

style issue: ws before (
Comment 2 Thomas Klausner 2015-01-19 12:45:07 UTC
Created attachment 294872 [details] [review]
Adapted patch, as requested.

I've adapted the patch per your comments. Is it ok now?
Comment 3 Jens Georg 2015-01-24 07:25:50 UTC
looking at the declaration of uuid_create(uuid_t *uuid, uint32_t *status), why are you passing 0 as second argument?

Shouldn't that be eihter a valid status or NULL for clarity?
Comment 4 Thomas Klausner 2015-01-25 07:44:08 UTC
Created attachment 295358 [details] [review]
Add more error handling

Thanks, that's a good point. I've added more error handling to the patch.
Comment 5 Jens Georg 2015-04-06 11:45:49 UTC
Created attachment 301005 [details] [review]
Use GUUL for native UUID support

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 6 Jens Georg 2015-04-06 11:49:25 UTC
Created attachment 301006 [details] [review]
Use GUUL for native UUID support

Signed-off-by: Jens Georg <mail@jensge.org>
Comment 7 Jens Georg 2015-04-06 11:53:22 UTC
Pushed as part of the UUID rework