diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-12-31 09:08:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:49:33 -0500 |
commit | 1d63dc5fe4000de6e3414e3eb45f65f6216cea61 (patch) | |
tree | 5034a77c1433a94baa6807be987c084af52331ca /source4/lib/system.c | |
parent | 76480dba70002a5e43a59319c3cc6b41e8388330 (diff) | |
download | samba-1d63dc5fe4000de6e3414e3eb45f65f6216cea61.tar.gz samba-1d63dc5fe4000de6e3414e3eb45f65f6216cea61.tar.bz2 samba-1d63dc5fe4000de6e3414e3eb45f65f6216cea61.zip |
r12641: - remove some unused functions
- we already call usleep() directly in some places,
so do it everywhere
metze
(This used to be commit 9eaf6e2c4d3dae3b6711e4aae3828222f5cab65e)
Diffstat (limited to 'source4/lib/system.c')
-rw-r--r-- | source4/lib/system.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/source4/lib/system.c b/source4/lib/system.c index 07afa904ca..655b4a1054 100644 --- a/source4/lib/system.c +++ b/source4/lib/system.c @@ -38,73 +38,6 @@ expansions/etc make sense to the OS should be acceptable to Samba. */ - - -/******************************************************************* - A wrapper for usleep in case we don't have one. -********************************************************************/ - -int sys_usleep(long usecs) -{ -#ifndef HAVE_USLEEP - struct timeval tval; -#endif - - /* - * We need this braindamage as the glibc usleep - * is not SPEC1170 complient... grumble... JRA. - */ - - if(usecs < 0 || usecs > 1000000) { - errno = EINVAL; - return -1; - } - -#if HAVE_USLEEP - usleep(usecs); - return 0; -#else /* HAVE_USLEEP */ - /* - * Fake it with select... - */ - tval.tv_sec = 0; - tval.tv_usec = usecs/1000; - select(0,NULL,NULL,NULL,&tval); - return 0; -#endif /* HAVE_USLEEP */ -} - - -/******************************************************************* -A read wrapper that will deal with EINTR. -********************************************************************/ - -ssize_t sys_read(int fd, void *buf, size_t count) -{ - ssize_t ret; - - do { - ret = read(fd, buf, count); - } while (ret == -1 && errno == EINTR); - return ret; -} - -/******************************************************************* -A write wrapper that will deal with EINTR. -********************************************************************/ - -ssize_t sys_write(int fd, const void *buf, size_t count) -{ - ssize_t ret; - - do { - ret = write(fd, buf, count); - } while (ret == -1 && errno == EINTR); - return ret; -} - - - /************************************************************************** A wrapper for gethostbyname() that tries avoids looking up hostnames in the root domain, which can cause dial-on-demand links to come up for no |