billiob pushed a commit to branch terminology-1.6.

http://git.enlightenment.org/apps/terminology.git/commit/?id=6bfd508a5887273b5b68a4d1bb973ed1bf4201e2

commit 6bfd508a5887273b5b68a4d1bb973ed1bf4201e2
Author: Boris Faure <[email protected]>
Date:   Wed Dec 4 21:44:37 2019 +0100

    tyfuzz: instead of writing to /dev/null, just do not write
---
 src/bin/termpty.c | 2 +-
 src/bin/termpty.h | 3 ---
 src/bin/tyfuzz.c  | 7 -------
 3 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 61f78cb..ccc05c5 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -1256,7 +1256,7 @@ termpty_write(Termpty *ty, const char *input, int len)
 #else
    int fd = ty->fd;
 #if defined(ENABLE_FUZZING)
-   fd = ty->fd_dev_null;
+   return;
 #endif
    if (fd < 0) return;
    if (write(fd, input, len) < 0)
diff --git a/src/bin/termpty.h b/src/bin/termpty.h
index ca1605c..b892051 100644
--- a/src/bin/termpty.h
+++ b/src/bin/termpty.h
@@ -170,9 +170,6 @@ struct _Termpty
    int fd, slavefd;
 #if defined(ENABLE_TESTS)
    struct ty_sb write_buffer;
-#endif
-#if defined(ENABLE_FUZZING)
-   int fd_dev_null;
 #endif
    struct {
       int curid;
diff --git a/src/bin/tyfuzz.c b/src/bin/tyfuzz.c
index 0b4f00b..8272b4a 100644
--- a/src/bin/tyfuzz.c
+++ b/src/bin/tyfuzz.c
@@ -263,10 +263,6 @@ _termpty_init(Termpty *ty, Config *config)
    assert(ty->screen2);
    ty->circular_offset = 0;
    ty->fd = STDIN_FILENO;
-#if defined(ENABLE_FUZZING)
-   ty->fd_dev_null = open("/dev/null", O_WRONLY|O_APPEND);
-   assert(ty->fd_dev_null >= 0);
-#endif
    ty->hl.bitmap = calloc(1, HL_LINKS_MAX / 8); /* bit map for 1 << 16 
elements */
    assert(ty->hl.bitmap);
    /* Mark id 0 as set */
@@ -281,9 +277,6 @@ _termpty_shutdown(Termpty *ty)
 #if defined(ENABLE_TESTS)
    ty_sb_free(&ty->write_buffer);
 #endif
-#if defined(ENABLE_FUZZING)
-   close(ty->fd_dev_null);
-#endif
 }
 
 int

-- 


Reply via email to