mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)
PATCH 1/1 mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)
TEMP_FAILURE_RETRY is not available on musl.
--- drivers/mbimmodem/mbim.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/mbimmodem/mbim.c +10 -0
@@ -37,6 +37,16 @@#include "mbim-message.h" #include "mbim-private.h" +/* taken from glibc unistd.h for musl support */ +#ifndef TEMP_FAILURE_RETRY +#define TEMP_FAILURE_RETRY (expression) \ + (__extension__ \ + ({ long int __result; \ + do __result = (long int) (expression); \ + while (__result == -1L && errno == EINTR); \ + __result; })) +#endif +#define MAX_CONTROL_TRANSFER 4096#define HEADER_SIZE (sizeof(struct mbim_message_header) + \ sizeof(struct mbim_fragment_header))
Signature · 1 line
2.20.1
Hi Nicolas,
Quoted 15 lines
TEMP_FAILURE_RETRYis not available on musl.Signed-off-by Nicolas Serafini <[email protected]>---
drivers/mbimmodem/mbim.c| 10 ++++++++++1 file changed, 10 insertions(+)drivers/mbimmodem/mbim.c +0
-0@@ -37,6 +37,16 @@#include "mbim-message.h" #include "mbim-private.h"
drivers/mbimmodem/mbim.c line 49
Quoted 10 lines
drivers/mbimmodem/mbim.c +10
-0+/* taken from glibc unistd.h for musl support */ +#ifndef TEMP_FAILURE_RETRY +#define TEMP_FAILURE_RETRY (expression) \ + (__extension__ \ + ({ long int __result; \ + do __result = (long int) (expression); \ + while (__result == -1L && errno == EINTR); \ + __result; })) +#endif +
or you use the notation that is used in src/storage.h and maybe even move it to a more common place. The TFR macro is used in various places.
Regards
Marcel
On Mon, 28 Jan 2019 13:34:37 +0100 Marcel Holtmann <[email protected]> wrote:
Hi Marcel,
Quoted 17 lines
Hi Nicolas,
Quoted 15 lines
TEMP_FAILURE_RETRYis not available on musl.Signed-off-by Nicolas Serafini <[email protected]>---
drivers/mbimmodem/mbim.c| 10 ++++++++++1 file changed, 10 insertions(+)drivers/mbimmodem/mbim.c +0
-0@@ -37,6 +37,16 @@#include "mbim-message.h" #include "mbim-private.h"
Quoted 14 lines
drivers/mbimmodem/mbim.c line 49
Quoted 10 lines
drivers/mbimmodem/mbim.c +10
-0+/* taken from glibc unistd.h for musl support */ +#ifndef TEMP_FAILURE_RETRY +#define TEMP_FAILURE_RETRY (expression) \ + (__extension__ \ + ({ long int __result; \ + do __result = (long int) (expression); \ + while (__result == -1L && errno == EINTR); \ + __result; })) +#endif +or you use the notation that is used in
src/storage.hand maybe even move it to a more common place. The TFR macro is used in various places.
Yes it's a good idea, what do you think about putting it in the "include/types.h" file.
Quoted 5 lines
Regards
Marcel
Regards
Nicolas