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.

173 lines
4.5 KiB

  1. From 6ed14d48f6e9a8dfb37cc68472b04cfb3673b7bd Mon Sep 17 00:00:00 2001
  2. From: Lee Duncan <lduncan@suse.com>
  3. Date: Fri, 27 Mar 2020 17:50:41 -0700
  4. Subject: [PATCH 1/3] Change include of <sys/poll.h> to <poll.h>
  5. The proper local is <poll.h>.
  6. ---
  7. iscsiuio/src/unix/nic_nl.c | 2 +-
  8. usr/discovery.c | 2 +-
  9. usr/event_poll.c | 2 +-
  10. usr/io.c | 2 +-
  11. usr/netlink.c | 2 +-
  12. 5 files changed, 5 insertions(+), 5 deletions(-)
  13. diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c
  14. index f8306563..dee462e7 100644
  15. --- a/iscsiuio/src/unix/nic_nl.c
  16. +++ b/iscsiuio/src/unix/nic_nl.c
  17. @@ -50,7 +50,7 @@
  18. #include <linux/netlink.h>
  19. #include <iscsi_if.h>
  20. #include <sys/ioctl.h>
  21. -#include <sys/poll.h>
  22. +#include <poll.h>
  23. #include <sys/types.h>
  24. #include <sys/user.h>
  25. #include <sys/socket.h>
  26. diff --git a/usr/discovery.c b/usr/discovery.c
  27. index 9ce122e1..7dec696f 100644
  28. --- a/usr/discovery.c
  29. +++ b/usr/discovery.c
  30. @@ -25,7 +25,7 @@
  31. #include <stdint.h>
  32. #include <stdlib.h>
  33. #include <string.h>
  34. -#include <sys/poll.h>
  35. +#include <poll.h>
  36. #include <sys/time.h>
  37. #include <sys/param.h>
  38. #include <sys/socket.h>
  39. diff --git a/usr/event_poll.c b/usr/event_poll.c
  40. index 4cf4ce2b..ffd12a37 100644
  41. --- a/usr/event_poll.c
  42. +++ b/usr/event_poll.c
  43. @@ -23,7 +23,7 @@
  44. */
  45. #include <stdlib.h>
  46. #include <errno.h>
  47. -#include <sys/poll.h>
  48. +#include <poll.h>
  49. #include <sys/types.h>
  50. #include <sys/wait.h>
  51. #include <sys/signalfd.h>
  52. diff --git a/usr/io.c b/usr/io.c
  53. index 210a10ad..a46c9f8c 100644
  54. --- a/usr/io.c
  55. +++ b/usr/io.c
  56. @@ -24,7 +24,7 @@
  57. #include <signal.h>
  58. #include <unistd.h>
  59. #include <fcntl.h>
  60. -#include <sys/poll.h>
  61. +#include <poll.h>
  62. #include <sys/ioctl.h>
  63. #include <netinet/tcp.h>
  64. #include <arpa/inet.h>
  65. diff --git a/usr/netlink.c b/usr/netlink.c
  66. index d42ca4fb..22cad834 100644
  67. --- a/usr/netlink.c
  68. +++ b/usr/netlink.c
  69. @@ -30,7 +30,7 @@
  70. #include <asm/types.h>
  71. #include <sys/socket.h>
  72. #include <sys/types.h>
  73. -#include <sys/poll.h>
  74. +#include <poll.h>
  75. #include <linux/netlink.h>
  76. #include "types.h"
  77. From fbe6c1c766a88edccb0d7f4168d2d87a3cdb4660 Mon Sep 17 00:00:00 2001
  78. From: Lee Duncan <lduncan@suse.com>
  79. Date: Fri, 27 Mar 2020 17:57:52 -0700
  80. Subject: [PATCH 2/3] Fix type mismatch under musl.
  81. It complains about rl.rlim_cur and rl.rlim_max being
  82. long long unsigned, so cast them, since it's debug
  83. messages anyway.
  84. ---
  85. usr/iscsi_util.c | 7 +++++--
  86. 1 file changed, 5 insertions(+), 2 deletions(-)
  87. diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c
  88. index fd8fc0cf..db1dc377 100644
  89. --- a/usr/iscsi_util.c
  90. +++ b/usr/iscsi_util.c
  91. @@ -152,7 +152,9 @@ int increase_max_files(void)
  92. log_debug(1, "Could not get file limit (err %d)", errno);
  93. return errno;
  94. }
  95. - log_debug(1, "Max file limits %lu %lu", rl.rlim_cur, rl.rlim_max);
  96. + log_debug(1, "Max file limits %lu %lu",
  97. + (long unsigned)rl.rlim_cur,
  98. + (long unsigned)rl.rlim_max);
  99. if (rl.rlim_cur < ISCSI_MAX_FILES)
  100. rl.rlim_cur = ISCSI_MAX_FILES;
  101. @@ -162,7 +164,8 @@ int increase_max_files(void)
  102. err = setrlimit(RLIMIT_NOFILE, &rl);
  103. if (err) {
  104. log_debug(1, "Could not set file limit to %lu/%lu (err %d)",
  105. - rl.rlim_cur, rl.rlim_max, errno);
  106. + (long unsigned)rl.rlim_cur,
  107. + (long unsigned)rl.rlim_max, errno);
  108. return errno;
  109. }
  110. From a93c2f1cf5a55887074bdda65aa6ad6c533191f0 Mon Sep 17 00:00:00 2001
  111. From: Lee Duncan <lduncan@suse.com>
  112. Date: Sun, 29 Mar 2020 11:01:07 -0700
  113. Subject: [PATCH 3/3] More changes for musl.
  114. Clean up some code that musl complains about. The
  115. changes all seem like a good idea in general, and
  116. should not effect functionality.
  117. ---
  118. usr/iscsistart.c | 1 -
  119. usr/mgmt_ipc.c | 1 +
  120. usr/statics.c | 3 +--
  121. 3 files changed, 2 insertions(+), 3 deletions(-)
  122. diff --git a/usr/iscsistart.c b/usr/iscsistart.c
  123. index 00a9c78a..ee810f7a 100644
  124. --- a/usr/iscsistart.c
  125. +++ b/usr/iscsistart.c
  126. @@ -30,7 +30,6 @@
  127. #include <time.h>
  128. #include <sys/mman.h>
  129. #include <sys/utsname.h>
  130. -#include <sys/signal.h>
  131. #include <sys/types.h>
  132. #include <sys/wait.h>
  133. diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
  134. index 51267c13..c292161f 100644
  135. --- a/usr/mgmt_ipc.c
  136. +++ b/usr/mgmt_ipc.c
  137. @@ -26,6 +26,7 @@
  138. #include <unistd.h>
  139. #include <pwd.h>
  140. #include <sys/un.h>
  141. +#include <string.h>
  142. #include "iscsid.h"
  143. #include "idbm.h"
  144. diff --git a/usr/statics.c b/usr/statics.c
  145. index 59fb044d..f59729ba 100644
  146. --- a/usr/statics.c
  147. +++ b/usr/statics.c
  148. @@ -1,6 +1,6 @@
  149. #include <unistd.h>
  150. #include <pwd.h>
  151. -#include <sys/errno.h>
  152. +#include <errno.h>
  153. #include <sys/types.h>
  154. static struct passwd root_pw = {
  155. @@ -17,4 +17,3 @@ getpwuid(uid_t uid)
  156. return 0;
  157. }
  158. }
  159. -