use usleep rather than sys_usleep in various places, in anticipation of usleep moving...
authorJelmer Vernooij <jelmer@samba.org>
Sat, 24 Mar 2012 19:43:07 +0000 (20:43 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 24 Mar 2012 21:41:05 +0000 (22:41 +0100)
source3/include/proto.h
source3/lib/system.c
source3/passdb/pdb_smbpasswd.c
source3/rpc_server/spoolss/srv_spoolss_nt.c
source3/utils/net_rpc_service.c
source3/utils/status_profile.c

index a4fb496ea9e7956aab1bb51da6a2f45291f29a35..779745a13e0c903337a87c64ddd33c814615c2cc 100644 (file)
@@ -318,7 +318,6 @@ int sys_set_nfs_quota(const char *path, const char *bdev,
 
 /* The following definitions come from lib/system.c  */
 
-int sys_usleep(long usecs);
 ssize_t sys_read(int fd, void *buf, size_t count);
 ssize_t sys_write(int fd, const void *buf, size_t count);
 ssize_t sys_writev(int fd, const struct iovec *iov, int iovcnt);
index 92e244fdbe9a47782f39f04b06395eca3c496879..238f84beeaa37ea0457852617afe3fc5e47cae0d 100644 (file)
 
 
 
-/*******************************************************************
- 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 > 999999) {
-               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.
 ********************************************************************/
index 4d5bed4e10ba59e12c54817e1fc9e7d5b23f307c..c1dabc4dfff225a99a8d021f48d911ca1866e687 100644 (file)
@@ -217,7 +217,7 @@ static FILE *startsmbfilepwent(const char *pfile, enum pwf_access_type type, int
                                        if((fd = sys_open(pfile, O_CREAT|O_TRUNC|O_EXCL|O_RDWR, 0600))!=-1) {
                                                break;
                                        }
-                                       sys_usleep(200); /* Spin, spin... */
+                                       usleep(200); /* Spin, spin... */
                                }
                                if(fd == -1) {
                                        DEBUG(0,("startsmbfilepwent_internal: too many race conditions \
index ef987e5fc913bbeb25f819e398c81b6faddfe717..c4e7e504ca0d385f500bd3f019d7857e21107151 100644 (file)
@@ -1957,7 +1957,7 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
                && (RA_WIN2K == get_remote_arch()) )
        {
                DEBUG(10,("_spoolss_OpenPrinterEx: Enabling LAN/WAN hack for Win2k clients.\n"));
-               sys_usleep( 500000 );
+               usleep( 500000 );
        }
 #endif
 
index d1208e2ce2aeb6bfa4f86b29e70fcd40a3d95827..523eafd6533a37381e708c93352f16619e552c0c 100644 (file)
@@ -200,7 +200,7 @@ static WERROR watch_service_state(struct rpc_pipe_client *pipe_hnd,
 
                d_printf(".");
                i++;
-               sys_usleep( 100 );
+               usleep( 100 );
        }
        d_printf("\n");
 
index c0eeb7a923a85b36eaa7e2a936fa978050d1527b..e01b1652abf940e1ca824d3ae1cf8da858a0a8d8 100644 (file)
@@ -563,7 +563,7 @@ bool status_profile_rates(bool verbose)
                                    (unsigned long )usec_to_msec(remain_usec));
                        }
 
-                       sys_usleep(remain_usec);
+                       usleep(remain_usec);
                }
 
        }