Skip to content

Commit

Permalink
semihosting: Fixed a warning being produced from the BMDA SYS_OPEN code
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmux committed Jan 14, 2024
1 parent e8d1629 commit 52095d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/target/semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,9 @@ int32_t semihosting_open(target_s *const target, const semihosting_s *const requ
O_WRONLY | O_CREAT | O_APPEND, /* a, ab */
O_RDWR | O_CREAT | O_APPEND, /* a+, a+b */
};
const int32_t native_open_mode =
native_open_mode_flags[request->params[1] >> 1U] | ((request->params[1] & 1U) ? O_BINARY : 0U);
int32_t native_open_mode = native_open_mode_flags[request->params[1] >> 1U];
if (request->params[1] & 1U)
native_open_mode |= O_BINARY;

const int32_t result = open(file_name, native_open_mode | O_NOCTTY, 0644);
target->tc->gdb_errno = semihosting_errno();
Expand Down

0 comments on commit 52095d9

Please sign in to comment.