Skip to content

Commit

Permalink
DAOS-16371 il: do not return unsupported for fputs if ioil is loaded
Browse files Browse the repository at this point in the history
Features: dfuse_unit
Required-githooks: true

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
  • Loading branch information
mchaarawi committed Aug 22, 2024
1 parent dd488d1 commit 6e00d2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/client/dfuse/il/int_posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2522,15 +2522,9 @@ dfuse_fputs(char *__str, FILE *stream)
if (drop_reference_if_disabled(entry))
goto do_real_fn;

D_ERROR("Unsupported function\n");

entry->fd_err = ENOTSUP;

DISABLE_STREAM(entry, stream);
vector_decref(&fd_table, entry);

errno = ENOTSUP;
return EOF;

do_real_fn:
return __real_fputs(__str, stream);
}
Expand All @@ -2553,13 +2547,9 @@ dfuse_fputws(const wchar_t *ws, FILE *stream)
if (drop_reference_if_disabled(entry))
goto do_real_fn;

entry->fd_err = ENOTSUP;

DISABLE_STREAM(entry, stream);
vector_decref(&fd_table, entry);

errno = ENOTSUP;
return -1;

do_real_fn:
return __real_fputws(ws, stream);
}
Expand Down
9 changes: 9 additions & 0 deletions src/tests/suite/dfuse_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@ do_stream(void **state)
rc = unlinkat(root, "stream_file", 0);
assert_return_code(rc, errno);

fd = openat(root, "stream_file2", O_RDWR | O_CREAT | O_EXCL, S_IWUSR | S_IRUSR);
assert_return_code(fd, errno);
stream = fdopen(fd, "w+");
assert_non_null(stream);

rc = fputs("Hello World!\n", stream);
assert_true(rc >= 0);
fclose(stream);

rc = close(root);
assert_return_code(rc, errno);
}
Expand Down

0 comments on commit 6e00d2c

Please sign in to comment.