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
…14989)

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@intel.com>
  • Loading branch information
mchaarawi authored Aug 26, 2024
1 parent 8a4cec4 commit 1f1881c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 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
10 changes: 9 additions & 1 deletion src/tests/suite/dfuse_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,17 @@ do_stream(void **state)
rc = fclose(stream);
assert_int_equal(rc, 0);

rc = unlinkat(root, "stream_file", 0);
fd = openat(root, "stream_file", O_RDWR | 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_return_code(rc, errno);
fclose(stream);

rc = unlinkat(root, "stream_file", 0);
assert_return_code(rc, errno);
rc = close(root);
assert_return_code(rc, errno);
}
Expand Down

0 comments on commit 1f1881c

Please sign in to comment.