]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/lib_twait.c
ncurses 5.6 - patch 20080412
[ncurses.git] / ncurses / tty / lib_twait.c
index e18756c2fc3f468eec8620368775b0672883dea8..ec9daae80390e8d272711dc49bd1befffa959676 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 # endif
 #endif
 
-MODULE_ID("$Id: lib_twait.c,v 1.52 2006/12/30 16:56:28 tom Exp $")
-
-#if HAVE_GETTIMEOFDAY
-# define PRECISE_GETTIME 1
-# define TimeType struct timeval
-#else
-# define PRECISE_GETTIME 0
-# define TimeType time_t
-#endif
+MODULE_ID("$Id: lib_twait.c,v 1.55 2008/03/01 22:08:31 tom Exp $")
 
 static long
 _nc_gettime(TimeType * t0, bool first)
@@ -152,7 +144,7 @@ _nc_timed_wait(int mode,
 {
     int fd;
     int count;
-    int result;
+    int result = 0;
     TimeType t0;
 
 #ifdef NCURSES_WGETCH_EVENTS
@@ -186,7 +178,7 @@ _nc_timed_wait(int mode,
     }
 #endif
 
-#if PRECISE_GETTIME
+#if PRECISE_GETTIME && HAVE_NANOSLEEP
   retry:
 #endif
     starttime = _nc_gettime(&t0, TRUE);