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.

58 lines
1.7 KiB

  1. Index: LVM2.2.02.118/lib/commands/toolcontext.c
  2. ===================================================================
  3. --- LVM2.2.02.118.orig/lib/commands/toolcontext.c
  4. +++ LVM2.2.02.118/lib/commands/toolcontext.c
  5. @@ -1625,8 +1625,10 @@ struct cmd_context *create_toolcontext(u
  6. unsigned threaded)
  7. {
  8. struct cmd_context *cmd;
  9. +#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
  10. FILE *new_stream;
  11. int flags;
  12. +#endif
  13. #ifdef M_MMAP_MAX
  14. mallopt(M_MMAP_MAX, 0);
  15. @@ -1662,7 +1664,7 @@ struct cmd_context *create_toolcontext(u
  16. /* FIXME Make this configurable? */
  17. reset_lvm_errno(1);
  18. -#ifndef VALGRIND_POOL
  19. +#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
  20. /* Set in/out stream buffering before glibc */
  21. if (set_buffering) {
  22. /* Allocate 2 buffers */
  23. @@ -2035,7 +2037,7 @@ void destroy_toolcontext(struct cmd_cont
  24. if (cmd->libmem)
  25. dm_pool_destroy(cmd->libmem);
  26. -#ifndef VALGRIND_POOL
  27. +#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
  28. if (cmd->linebuffer) {
  29. /* Reset stream buffering to defaults */
  30. if (is_valid_fd(STDIN_FILENO) &&
  31. Index: LVM2.2.02.118/tools/lvmcmdline.c
  32. ===================================================================
  33. --- LVM2.2.02.118.orig/tools/lvmcmdline.c
  34. +++ LVM2.2.02.118/tools/lvmcmdline.c
  35. @@ -1602,6 +1602,7 @@ int lvm_split(char *str, int *argc, char
  36. /* Make sure we have always valid filedescriptors 0,1,2 */
  37. static int _check_standard_fds(void)
  38. {
  39. +#ifdef __GLIBC__
  40. int err = is_valid_fd(STDERR_FILENO);
  41. if (!is_valid_fd(STDIN_FILENO) &&
  42. @@ -1628,6 +1629,12 @@ static int _check_standard_fds(void)
  43. strerror(errno));
  44. return 0;
  45. }
  46. +#else
  47. + if (!is_valid_fd(STDERR_FILENO) ||
  48. + !is_valid_fd(STDOUT_FILENO) ||
  49. + !is_valid_fd(STDIN_FILENO))
  50. + return 0;
  51. +#endif
  52. return 1;
  53. }