keygen/src/main.c
/**
 * start_sodium() - Helper function to start sodium
 *
 * Return: 1 on success, 0 on failure
 */
Helper function to start sodium
Return: 1 on success, 0 on failure
Helper function to start sodium Return : 1 on success 0 on failure
static int start_sodium()
{
#if defined(__linux__) && defined(RNDGETENTCNT)
    int rand_fd;
    int ent_count;
    if ((rand_fd = open("/dev/random", O_RDONLY)) != -1) {
        if (ioctl(rand_fd, RNDGETENTCNT, &ent_count) == 0 && ent_count < 160) {
            return 0;
        }
        (void) close(rand_fd);
    }
#endif
    return (sodium_init() != -1);
}
static int start_sodium ( ) { #if defined ( __linux__ ) && defined ( RNDGETENTCNT ) int rand_fd ; int ent_count ; if ( ( rand_fd = open ( " " , O_RDONLY ) ) != -1 ) { if ( ioctl ( rand_fd , RNDGETENTCNT , & ent_count ) == 0 && ent_count < 160 ) { return 0 ; } ( void ) close ( rand_fd ) ; } #endif return ( sodium_init ( ) != -1 ) ; }
start_sodium() - Helper function to start sodium
 Return: 1 on success, 0 on failure
start_sodium () - Helper function to start sodium Return : 1 on success 0 on failure