All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] emulator/serial.c: use posix_openpt() instead of getpt()
@ 2014-10-04 14:31 basile
  2014-10-07 14:56 ` Johan Hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: basile @ 2014-10-04 14:31 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: blueness, pacho, Anthony G. Basile

From: "Anthony G. Basile" <basile@opensource.dyc.edu>

getpt(3) is glibc-specific and is not provided in musl and possibly
other libc's. Instead, we use use posix_openpt(3) which is equivalent
and portable.

Signed-off-by: Anthony G. Basile <basile@opensource.dyc.edu>
---
 emulator/serial.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/emulator/serial.c b/emulator/serial.c
index 9583be4..8b49dc6 100644
--- a/emulator/serial.c
+++ b/emulator/serial.c
@@ -32,6 +32,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+#include <fcntl.h>
 #include <sys/param.h>
 #include <sys/epoll.h>
 #include <sys/uio.h>
@@ -160,7 +161,7 @@ static void open_pty(struct serial *serial)
 {
 	enum btdev_type uninitialized_var(type);
 
-	serial->fd = getpt();
+	serial->fd = posix_openpt(O_RDWR | O_NOCTTY);
 	if (serial->fd < 0) {
 		perror("Failed to get master pseudo terminal");
 		return;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] emulator/serial.c: use posix_openpt() instead of getpt()
  2014-10-04 14:31 [PATCH] emulator/serial.c: use posix_openpt() instead of getpt() basile
@ 2014-10-07 14:56 ` Johan Hedberg
  2014-10-07 17:56   ` Anthony G. Basile
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2014-10-07 14:56 UTC (permalink / raw)
  To: basile; +Cc: linux-bluetooth, blueness, pacho

Hi Anthony,

On Sat, Oct 04, 2014, basile@opensource.dyc.edu wrote:
> From: "Anthony G. Basile" <basile@opensource.dyc.edu>
> 
> getpt(3) is glibc-specific and is not provided in musl and possibly
> other libc's. Instead, we use use posix_openpt(3) which is equivalent
> and portable.
> 
> Signed-off-by: Anthony G. Basile <basile@opensource.dyc.edu>
> ---
>  emulator/serial.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks. I first had to remove the Signed-off-by line though
since we don't don't use that convention for user space patches.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] emulator/serial.c: use posix_openpt() instead of getpt()
  2014-10-07 14:56 ` Johan Hedberg
@ 2014-10-07 17:56   ` Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2014-10-07 17:56 UTC (permalink / raw)
  To: linux-bluetooth, blueness, pacho

On 10/07/14 10:56, Johan Hedberg wrote:
> Hi Anthony,
>
> On Sat, Oct 04, 2014, basile@opensource.dyc.edu wrote:
>> From: "Anthony G. Basile" <basile@opensource.dyc.edu>
>>
>> getpt(3) is glibc-specific and is not provided in musl and possibly
>> other libc's. Instead, we use use posix_openpt(3) which is equivalent
>> and portable.
>>
>> Signed-off-by: Anthony G. Basile <basile@opensource.dyc.edu>
>> ---
>>   emulator/serial.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> Applied, thanks. I first had to remove the Signed-off-by line though
> since we don't don't use that convention for user space patches.
>
> Johan
>

That's fine.

-- 
Anthony G. Basile, Ph. D.
Chair of Information Technology
D'Youville College
Buffalo, NY 14201
(716) 829-8197

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-07 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-04 14:31 [PATCH] emulator/serial.c: use posix_openpt() instead of getpt() basile
2014-10-07 14:56 ` Johan Hedberg
2014-10-07 17:56   ` Anthony G. Basile

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.