Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/utils.c @ 419:2f9852610cf4
Small code review
Some clean up and security checks
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 02 Sep 2005 20:34:17 +0200 |
parents | f8f3c7493457 |
children | 4470868f90e5 |
comparison
equal
deleted
inserted
replaced
418:05bcc91b8699 | 419:2f9852610cf4 |
---|---|
221 | 221 |
222 retval += tzoff; | 222 retval += tzoff; |
223 | 223 |
224 return retval; | 224 return retval; |
225 } | 225 } |
226 | |
227 // Should only be used for delays < 1s | |
228 inline void safe_usleep(unsigned int usec) | |
229 { | |
230 struct timespec req; | |
231 req.tv_sec = 0; | |
232 req.tv_nsec = (long)usec * 1000L; | |
233 nanosleep(&req, NULL); | |
234 } |