Skip to content

Commit 72b98dd

Browse files
committed
Temporarily reverted change to writev to work around an issue.
1 parent 369fe49 commit 72b98dd

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

core/shared/platform/zephyr/zephyr_file.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,16 +600,20 @@ os_writev(os_file_handle handle, const struct __wasi_ciovec_t *iov, int iovcnt,
600600
{
601601
ssize_t total_written = 0;
602602

603+
struct zephyr_fs_desc *ptr = NULL;
604+
GET_FILE_SYSTEM_DESCRIPTOR(handle->fd, ptr);
605+
603606
// If the fd is stdout or stderr, we call fwrite
604-
if ((handle->fd == STDOUT_FILENO) || (handle->fd == STDERR_FILENO)) {
607+
if (strncmp(ptr->path, "std", 3) == 0) {
608+
// SRB -- FIX if ((handle->fd == STDOUT_FILENO) || (handle->fd ==
609+
// STDERR_FILENO)) {
605610
FILE *fd = stdout;
606611
if (handle->fd == STDERR_FILENO) {
607612
fd = stderr;
608613
}
609614

610615
for (int i = 0; i < iovcnt; i++) {
611-
ssize_t bytes_written =
612-
fwrite(iov[i].buf, 1, iov[i].buf_len, fd);
616+
ssize_t bytes_written = fwrite(iov[i].buf, 1, iov[i].buf_len, fd);
613617

614618
if (bytes_written < 0) {
615619
return convert_errno(-bytes_written);
@@ -624,8 +628,8 @@ os_writev(os_file_handle handle, const struct __wasi_ciovec_t *iov, int iovcnt,
624628
}
625629
}
626630
else {
627-
struct zephyr_fs_desc *ptr = NULL;
628-
GET_FILE_SYSTEM_DESCRIPTOR(handle->fd, ptr);
631+
// SRB struct zephyr_fs_desc *ptr = NULL;
632+
// SRB GET_FILE_SYSTEM_DESCRIPTOR(handle->fd, ptr);
629633

630634
// Write data from each buffer
631635
for (int i = 0; i < iovcnt; i++) {

0 commit comments

Comments
 (0)