git.samba.org
/
jelmer
/
loudmouth.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
be70228
)
use time
author
hallski
<hallski>
Mon, 11 Sep 2006 19:19:30 +0000
(19:19 +0000)
committer
hallski
<hallski>
Mon, 11 Sep 2006 19:19:30 +0000
(19:19 +0000)
loudmouth/lm-utils.c
patch
|
blob
|
history
diff --git
a/loudmouth/lm-utils.c
b/loudmouth/lm-utils.c
index d80e1ede9381f27e98f9df6b7e6e6293b9e87c10..370f6a30e61b34140edc9337426131d4cf745f2d 100644
(file)
--- a/
loudmouth/lm-utils.c
+++ b/
loudmouth/lm-utils.c
@@
-70,12
+70,14
@@
_lm_utils_free_callback (LmCallback *cb)
gchar *
_lm_utils_generate_id (void)
{
- static guint last_id = 0;
- gint random;
-
- random = g_random_int ();
-
- return g_strdup_printf ("%o%o", last_id++ ^ random, random);
+ static guint last_id = 0;
+ GTimeVal tv;
+ glong val;
+
+ g_get_current_time (&tv);
+ val = (tv.tv_sec & tv.tv_usec) + last_id++;
+
+ return g_strdup_printf ("%ld%ld", val, tv.tv_usec);
}
gchar *