From 36bd5c9a44c57d4af146759eb0b11519c2543d42 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Thu, 2 Jul 2020 23:29:44 -0400 Subject: [PATCH] Delete unnecessary example src/ptmx.c --- src/Makefile | 2 +- src/ptmx.c | 52 ---------------------------------------------------- 2 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 src/ptmx.c diff --git a/src/Makefile b/src/Makefile index d793e9a..9c51b55 100644 --- a/src/Makefile +++ b/src/Makefile @@ -14,7 +14,7 @@ HEADERS = kiss.h ax25.h ax25/if.h ax25/macros.h ax25/proto.h \ OBJS = kiss.o ax25.o if.o call.o frame.o sock.o route.o server.o \ list.o hash.o dict.o -EXAMPLES = decode ptmx testclient-connect testclient-listen testserver +EXAMPLES = testserver testclient-connect testclient-listen decode HEADERS_BUILD = $(addprefix $(INCLUDE_PATH)/$(HEADER_SUBDIR)/, $(HEADERS)) diff --git a/src/ptmx.c b/src/ptmx.c deleted file mode 100644 index 0bc3ab5..0000000 --- a/src/ptmx.c +++ /dev/null @@ -1,52 +0,0 @@ -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char **argv) { - int ptm; - char ptsname[64]; - - if ((ptm = open("/dev/ptmx", O_RDWR)) < 0) { - fprintf(stderr, "%s: %s: %s: %s\n", argv[0], "open()", "/dev/ptmx", strerror(errno)); - - goto error_open_ptmx; - } - - if (grantpt(ptm) < 0) { - fprintf(stderr, "%s: %s: %s\n", argv[0], "grantpt()", strerror(errno)); - - goto error_grantpt_ptm; - } - - if (unlockpt(ptm) < 0) { - fprintf(stderr, "%s: %s: %s\n", argv[0], "unlockpt()", strerror(errno)); - - goto error_unlockpt_ptm; - } - - if (ptsname_r(ptm, ptsname, sizeof(ptsname)) < 0) { - fprintf(stderr, "%s: %s: %s: %s\n", argv[0], "ptsname_r()", "/dev/ptmx", strerror(errno)); - - goto error_ptsname_r_ptm; - } - - printf("pts %s\n", ptsname); - - close(ptm); - - return 0; - -error_unlockpt_ptm: -error_grantpt_ptm: -error_ptsname_r_ptm: - close(ptm); - -error_open_ptmx: - return 127; -}