From 3ab984176452000cc845adfb4afc8808a404a3c6 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Thu, 1 Apr 2004 03:48:51 +0000 Subject: use our own portable version of usleep using select() git-svn-id: https://svn.musicpd.org/mpd/trunk@578 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/utils.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index 63c57de26..6e2d6e1e3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -18,8 +18,13 @@ #include "utils.h" +#include #include #include +#include +#include +#include +#include char * myFgets(char * buffer, int bufferSize, FILE * fp) { char * ret = fgets(buffer,bufferSize,fp); @@ -43,3 +48,12 @@ void stripReturnChar(char * string) { *string = ' '; } } + +void my_usleep(long usec) { + struct timeval tv; + + tv.tv_sec = 0; + tv.tv_usec = usec; + + select(0,NULL,NULL,NULL,&tv); +} -- cgit v1.2.3