aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.c
diff options
context:
space:
mode:
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2008-04-07 05:22:54 +0000
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2008-04-07 05:22:54 +0000
commitc3af6aae8a8dc5a8d82dcb207ff75f6ab3565cc7 (patch)
tree3f861f04f60e8872bcf7f82f56de654af93a7590 /epan/emem.c
parentb8844e230b5391353b659cb5bcd87a4c8b94dc89 (diff)
- Remove GLIB1 code
- Change ugly GLIB version checking statements to GLIB_CHECK_VERSION - Remove ws_strsplit files because we no longer need to borrow GLIB2's g_strsplit code for the no longer supported GLIB1 builds git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24829 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/emem.c')
-rw-r--r--epan/emem.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/epan/emem.c b/epan/emem.c
index 593f814ac2..7e2c43ebd6 100644
--- a/epan/emem.c
+++ b/epan/emem.c
@@ -145,13 +145,8 @@ static intptr_t pagesize;
void
emem_canary(guint8 *canary) {
int i;
-#if GLIB_MAJOR_VERSION >= 2
static GRand *rand_state = NULL;
-#endif
-
- /* First, use GLib's random function if we have it */
-#if GLIB_MAJOR_VERSION >= 2
if (rand_state == NULL) {
rand_state = g_rand_new();
}
@@ -159,26 +154,6 @@ emem_canary(guint8 *canary) {
canary[i] = (guint8) g_rand_int(rand_state);
}
return;
-#else
- FILE *fp;
- size_t sz;
- /* Try /dev/urandom */
- if ((fp = eth_fopen("/dev/urandom", "r")) != NULL) {
- setbuf(fp, NULL);
- sz = fread(canary, 1, EMEM_CANARY_DATA_SIZE, fp);
- fclose(fp);
- if (sz == EMEM_CANARY_DATA_SIZE) {
- return;
- }
- }
-
- /* Our last resort */
- srandom(time(NULL) | getpid());
- for (i = 0; i < EMEM_CANARY_DATA_SIZE; i ++) {
- canary[i] = (guint8) random();
- }
- return;
-#endif /* GLIB_MAJOR_VERSION >= 2 */
}
#if !defined(SE_DEBUG_FREE)