Skip to content

Commit

Permalink
Review get_os_platform_id
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Dec 10, 2023
1 parent d477dbf commit ad2069f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ int_least32_t environment::get_os_platform_id() {
#if defined(__ANDROID__)
return PLATFORM_ANDROID;
#else
return create_process("uname -a").find("Linux") != string::npos ? PLATFORM_LINUX : PLATFORM_UNIX;
if (create_process("uname -a").find("Linux") != string::npos) return PLATFORM_LINUX;
return PLATFORM_UNIX;
#endif
}

Expand Down
3 changes: 2 additions & 1 deletion src/xtd.core.native.unix/src/xtd/native/unix/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ string environment::get_machine_name() {
}

int_least32_t environment::get_os_platform_id() {
return create_process("uname -a").find("FreeBSD") != string::npos ? PLATFORM_FREEBSD : PLATFORM_UNIX;
if (create_process("uname -a").find("FreeBSD") != string::npos) return PLATFORM_FREEBSD;
return PLATFORM_UNIX;
}

void environment::get_os_version(int_least32_t& major, int_least32_t& minor, int_least32_t& build, int_least32_t& revision) {
Expand Down

0 comments on commit ad2069f

Please sign in to comment.