You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  1. --- a/lib/commands/toolcontext.c
  2. +++ b/lib/commands/toolcontext.c
  3. @@ -1605,7 +1605,7 @@ struct cmd_context *create_toolcontext(u
  4. /* FIXME Make this configurable? */
  5. reset_lvm_errno(1);
  6. -#ifndef VALGRIND_POOL
  7. +#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
  8. /* Set in/out stream buffering before glibc */
  9. if (set_buffering
  10. #ifdef SYS_gettid
  11. @@ -1986,7 +1986,7 @@ void destroy_toolcontext(struct cmd_cont
  12. if (cmd->pending_delete_mem)
  13. dm_pool_destroy(cmd->pending_delete_mem);
  14. -#ifndef VALGRIND_POOL
  15. +#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
  16. if (cmd->linebuffer) {
  17. /* Reset stream buffering to defaults */
  18. if (is_valid_fd(STDIN_FILENO) &&
  19. --- a/tools/lvmcmdline.c
  20. +++ b/tools/lvmcmdline.c
  21. @@ -3241,6 +3241,7 @@ int lvm_split(char *str, int *argc, char
  22. /* Make sure we have always valid filedescriptors 0,1,2 */
  23. static int _check_standard_fds(void)
  24. {
  25. +#ifdef __GLIBC__
  26. int err = is_valid_fd(STDERR_FILENO);
  27. if (!is_valid_fd(STDIN_FILENO) &&
  28. @@ -3267,6 +3268,12 @@ static int _check_standard_fds(void)
  29. strerror(errno));
  30. return 0;
  31. }
  32. +#else
  33. + if (!is_valid_fd(STDERR_FILENO) ||
  34. + !is_valid_fd(STDOUT_FILENO) ||
  35. + !is_valid_fd(STDIN_FILENO))
  36. + return 0;
  37. +#endif
  38. return 1;
  39. }