diff --git a/sal/inc/oslrandom.h b/sal/inc/oslrandom.h index b65878433225..891277bba675 100644 --- a/sal/inc/oslrandom.h +++ b/sal/inc/oslrandom.h @@ -16,7 +16,7 @@ extern "C" { #endif -int osl_get_system_random_data(char* buffer, size_t desired_len); +bool osl_get_system_random_data(char* buffer, size_t desired_len); #if defined __cplusplus } diff --git a/sal/osl/unx/random.cxx b/sal/osl/unx/random.cxx index e8379f8f0bf7..fbb2d7dedb90 100644 --- a/sal/osl/unx/random.cxx +++ b/sal/osl/unx/random.cxx @@ -14,7 +14,7 @@ #include #include -int osl_get_system_random_data(char* buffer, size_t desired_len) +bool osl_get_system_random_data(char* buffer, size_t desired_len) { int fd; diff --git a/sal/osl/w32/random.cxx b/sal/osl/w32/random.cxx index a2c364da2ebb..27ee14fdd6d4 100644 --- a/sal/osl/w32/random.cxx +++ b/sal/osl/w32/random.cxx @@ -14,7 +14,7 @@ #include -int osl_get_system_random_data(char* buffer, size_t desired_len) +bool osl_get_system_random_data(char* buffer, size_t desired_len) { unsigned int val; @@ -29,7 +29,7 @@ int osl_get_system_random_data(char* buffer, size_t desired_len) } if (rand_s(&val)) { - return 0; + return false; } memcpy(buffer, &val, len); buffer += len; @@ -40,7 +40,7 @@ int osl_get_system_random_data(char* buffer, size_t desired_len) { if (rand_s(reinterpret_cast(buffer))) { - return 0; + return false; } else { @@ -53,11 +53,11 @@ int osl_get_system_random_data(char* buffer, size_t desired_len) { if (rand_s(&val)) { - return 0; + return false; } memcpy(buffer, &val, desired_len); } - return 1; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */