Hi Johan, >> + fd = open("/dev/urandom", O_RDONLY); >> + if (fd < 0) { >> + ssize_t n; >> + >> + n = read(fd, &seed, sizeof(seed)); >> + if (n < (ssize_t) sizeof(seed)) >> + seed = time(NULL); >> + >> + close(fd); >> + } else >> + seed = time(NULL); > > So, it's not always wise to go blindly copying code examples/suggestions > from Marcel without thinking a bit. You're checking for invalid fd when > you should be checking for a valid one (>= 0). good one. Having to read this again, can someone please tell when a Linux platform will not have /dev/urandom and we really need to care? Wouldn't it be better to bail out loudly with an error message and do not use any auto pair feature at all. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html