[2546] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[PATCH] Use fpathconf to disable signals

daemon@ATHENA.MIT.EDU (=?UTF-8?q?Alejandro=20R=2E=20Sede=)
Tue Jul 20 10:22:04 2010

From: =?UTF-8?q?Alejandro=20R=2E=20Sede=C3=B1o?= <asedeno@MIT.EDU>
To: barnowl-dev@mit.edu
Date: Tue, 20 Jul 2010 10:20:55 -0400

Just using 0 is not portable. POSIX provides a portable way to find
the right value.

Reported-By: Benjamin Kaduk <kaduk@mit.edu>
---
 owl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/owl.c b/owl.c
index d1068a3..833285b 100644
--- a/owl.c
+++ b/owl.c
@@ -136,8 +136,8 @@ void owl_start_curses(void) {
 
   tcgetattr(0, &tio);
   tio.c_iflag &= ~(ISTRIP|IEXTEN);
-  tio.c_cc[VQUIT] = 0;
-  tio.c_cc[VSUSP] = 0;
+  tio.c_cc[VQUIT] = fpathconf(STDIN, _PC_VDISABLE);
+  tio.c_cc[VSUSP] = fpathconf(STDIN, _PC_VDISABLE);
   tcsetattr(0, TCSAFLUSH, &tio);
 
   /* screen init */
-- 
1.7.1.1


home help back first fref pref prev next nref lref last post