static void
_get_system_info (mongoc_handshake_t *handshake)
{
   handshake->os_type = _get_os_type ();

#ifdef MONGOC_OS_IS_LINUX
   _mongoc_linux_distro_scanner_get_distro (&handshake->os_name,
                                            &handshake->os_version);
#else
   handshake->os_name = _get_os_name ();
   handshake->os_version = _get_os_version ();
#endif

   handshake->os_architecture = _get_os_architecture ();
}
Example #2
0
/* We only expect this function to actually read anything on linux platforms */
static void
test_distro_scanner_reads (void)
{
   char *name;
   char *version;

   _mongoc_linux_distro_scanner_get_distro (&name, &version);

#ifdef __linux__
   ASSERT (name);
   ASSERT (strlen (name) > 0);

   /* Some linux distros don't have a version (like arch) but we should always
    * return a version (at the very least, we'll return the kernel version) */
   ASSERT (version);
   ASSERT (strlen (version));
#endif
}