pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:2259:    }   }   #else   static int random_fd = -1;   PIKECLASS RandomSystem   {    INHERIT RandomInterface;       PIKEFUN string(8bit) random_string(int len)    { -  if( len<1 ) +  if( len==0 )    RETURN empty_pike_string; -  +  if( len<0 ) +  Pike_error("Bad argument 1 to random_string(). Expected int(0..).\n");       if( random_fd==-1 )    {    random_fd = open("/dev/urandom", O_RDONLY);    if( random_fd==-1 )    Pike_error("Failed to open /dev/urandom.\n");    }       struct pike_string *ret = begin_shared_string(len);    char* str = ret->str;