* [PATCH] mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)
@ 2019-01-28 9:32 Nicolas Serafini
2019-01-28 12:34 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Serafini @ 2019-01-28 9:32 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 987 bytes --]
TEMP_FAILURE_RETRY is not available on musl.
Signed-off-by: Nicolas Serafini <nicolas.serafini@sensefly.com>
---
drivers/mbimmodem/mbim.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/mbimmodem/mbim.c b/drivers/mbimmodem/mbim.c
index 54b18acf..4b040528 100644
--- a/drivers/mbimmodem/mbim.c
+++ b/drivers/mbimmodem/mbim.c
@@ -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))
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)
2019-01-28 9:32 [PATCH] mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile) Nicolas Serafini
@ 2019-01-28 12:34 ` Marcel Holtmann
2019-01-28 15:19 ` Nicolas Serafini
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Holtmann @ 2019-01-28 12:34 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]
Hi Nicolas,
> TEMP_FAILURE_RETRY is not available on musl.
>
> Signed-off-by: Nicolas Serafini <nicolas.serafini@sensefly.com>
> ---
> drivers/mbimmodem/mbim.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/mbimmodem/mbim.c b/drivers/mbimmodem/mbim.c
> index 54b18acf..4b040528 100644
> --- a/drivers/mbimmodem/mbim.c
> +++ b/drivers/mbimmodem/mbim.c
> @@ -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
> +
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile)
2019-01-28 12:34 ` Marcel Holtmann
@ 2019-01-28 15:19 ` Nicolas Serafini
0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Serafini @ 2019-01-28 15:19 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]
On Mon, 28 Jan 2019 13:34:37 +0100 Marcel Holtmann <marcel@holtmann.org> wrote:
Hi Marcel,
>Hi Nicolas,
>
>> TEMP_FAILURE_RETRY is not available on musl.
>>
>> Signed-off-by: Nicolas Serafini <nicolas.serafini@sensefly.com>
>> ---
>> drivers/mbimmodem/mbim.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/mbimmodem/mbim.c b/drivers/mbimmodem/mbim.c
>> index 54b18acf..4b040528 100644
>> --- a/drivers/mbimmodem/mbim.c
>> +++ b/drivers/mbimmodem/mbim.c
>> @@ -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
>> +
>
>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.
Yes it's a good idea, what do you think about putting it in the "include/types.h" file.
>
>Regards
>
>Marcel
>
Regards
Nicolas
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-28 15:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-28 9:32 [PATCH] mbim: add optional copy of TEMP_FAILURE_RETRY macro (fix musl compile) Nicolas Serafini
2019-01-28 12:34 ` Marcel Holtmann
2019-01-28 15:19 ` Nicolas Serafini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.