Skip to content

Commit

Permalink
mxq_util: Add mx_sleep()
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed May 7, 2015
1 parent 4dc1f63 commit 874d496
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mx_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 3 additions & 0 deletions mx_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 874d496

Please sign in to comment.