From 874d4967d8060a422cf395879d79a44644ac5cc7 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Thu, 7 May 2015 15:54:40 +0200 Subject: [PATCH] mxq_util: Add mx_sleep() --- mx_util.c | 13 +++++++++++++ mx_util.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/mx_util.c b/mx_util.c index a159067..14741ba 100644 --- a/mx_util.c +++ b/mx_util.c @@ -594,3 +594,16 @@ int mx_open_newfile(char *fname) return fh; } + +int mx_sleep(unsigned int seconds) +{ + if (seconds) + return sleep(seconds); + return 0; +} + +int mx_sleep_nofail(unsigned int seconds) +{ + mx_sleep(seconds); + return 1; +} diff --git a/mx_util.h b/mx_util.h index f00e645..dbc50e5 100644 --- a/mx_util.h +++ b/mx_util.h @@ -43,4 +43,7 @@ int mx_setenvf_forever(const char *name, char *fmt, ...) __attribute__ ((format( int mx_open_newfile(char *fname); +int mx_sleep(unsigned int seconds); +int mx_sleep_nofail(unsigned int seconds); + #endif