AIX has already has a function called msleep(). Bugzilla #1098.
authorTim Potter <tpot@samba.org>
Fri, 20 Feb 2004 22:42:39 +0000 (22:42 +0000)
committerTim Potter <tpot@samba.org>
Fri, 20 Feb 2004 22:42:39 +0000 (22:42 +0000)
(This used to be commit 90ae3667448be9b3445f401bcd9d7e3eba374215)

source3/lib/smbldap.c
source3/lib/util.c
source3/lib/util_sock.c
source3/libsmb/clilist.c
source3/libsmb/clirap.c
source3/sam/idmap_ldap.c
source3/torture/msgtest.c
source3/torture/torture.c

index 925bc1fbf0e0edcb08f13176395eeb0bf3719b51..bb16517149b82597ca49a79c47114909199bbf40 100644 (file)
@@ -888,7 +888,7 @@ int smbldap_retry_open(struct smbldap_state *ldap_state, int *attempts)
                 */
                DEBUG(3, ("Sleeping for %u milliseconds before reconnecting\n", 
                          sleep_time));
-               msleep(sleep_time);
+               smb_msleep(sleep_time);
        }
        (*attempts)++;
 
@@ -935,7 +935,7 @@ int smbldap_search(struct smbldap_state *ldap_state,
                if (sleep_time > 0) {
                        /* we wait for the LDAP replication */
                        DEBUG(5,("smbldap_search: waiting %d milliseconds for LDAP replication.\n",sleep_time));
-                       msleep(sleep_time);
+                       smb_msleep(sleep_time);
                        DEBUG(5,("smbldap_search: go on!\n"));
                        ZERO_STRUCT(ldap_state->last_rebind);
                }
index 61dbc2cb2afe4239346e47954a181b1c9f39bd4a..f169a3103e5d3a5c9455fb3fc9ad5fd2173df750 100644 (file)
@@ -769,7 +769,7 @@ SMB_OFF_T transfer_file(int infd,int outfd,SMB_OFF_T n)
  Sleep for a specified number of milliseconds.
 ********************************************************************/
 
-void msleep(unsigned int t)
+void smb_msleep(unsigned int t)
 {
        unsigned int tdiff=0;
        struct timeval tval,t1,t2;  
index 782f5f3f7310aa41dbac2badfacf159bbe55c771..a275ddabb9af6406faa802d1fc95ef3e4155005e 100644 (file)
@@ -740,7 +740,7 @@ int open_socket_out(int type, struct in_addr *addr, int port ,int timeout)
        /* Some systems return EAGAIN when they mean EINPROGRESS */
        if (ret < 0 && (errno == EINPROGRESS || errno == EALREADY ||
                        errno == EAGAIN) && (connect_loop < timeout) ) {
-               msleep(connect_loop);
+               smb_msleep(connect_loop);
                connect_loop += increment;
                if (increment < 250) {
                        /* After 8 rounds we end up at a max of 255 msec */
index 2c1831ae990a35e5efa7c82162f350015a7a9eeb..ab157d48e963cad0e5be50482df18685950cdf74 100644 (file)
@@ -232,7 +232,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
                        cli_dos_error(cli, &eclass, &ecode);
                        if (eclass != ERRSRV || ecode != ERRerror)
                                break;
-                       msleep(100);
+                       smb_msleep(100);
                        continue;
                }
 
index 36bc403e0b4a44cb89335a098cff87baf2f9cb28..e403a78cdd8be199765d544d3d4c5e337672668e 100644 (file)
@@ -408,7 +408,7 @@ BOOL cli_qpathinfo(struct cli_state *cli, const char *fname,
                        uint32 ecode;
                        cli_dos_error(cli, &eclass, &ecode);
                        if (eclass != ERRSRV || ecode != ERRerror) break;
-                       msleep(100);
+                       smb_msleep(100);
                }
        } while (count-- && ret==False);
 
@@ -715,7 +715,7 @@ NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstrin
                        uint32 ecode;
                        cli_dos_error(cli, &eclass, &ecode);
                        if (eclass != ERRSRV || ecode != ERRerror) break;
-                       msleep(100);
+                       smb_msleep(100);
                }
        } while (count-- && ret==False);
 
index a2afd7d424ac594931b4079668b4eb830a26d944..55f45784481e6f1dcdf8cddf9fc62e0addf15c82 100644 (file)
@@ -351,7 +351,7 @@ static NTSTATUS ldap_next_rid(struct ldap_idmap_state *state, uint32 *rid,
                        attempts += 1;
                        
                        sleeptime %= 100;
-                       msleep(sleeptime);
+                       smb_msleep(sleeptime);
                }
        }
 
index 8abb0a20d2e6ff275db06705d88e6d8577f76caa..c40973a75c80c056c1923398f9356a29b1539e42 100644 (file)
@@ -63,7 +63,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len)
 
        while (pong_count < i) {
                message_dispatch();
-               msleep(1);
+               smb_msleep(1);
        }
 
        /* Now test that the duplicate filtering code works. */
@@ -78,7 +78,7 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len)
 
        for (i=0;i<n;i++) {
                message_dispatch();
-               msleep(1);
+               smb_msleep(1);
        }
 
        if (pong_count != 2) {
index 2e6bc49d55ac04e7f107cdfd03a93988e142baa1..9d0a6bb79e6b6048cd90f54ddb833e8fca962c17 100644 (file)
@@ -389,7 +389,7 @@ static BOOL rw_torture3(struct cli_state *c, char *lockfname)
                {
                        fnum = cli_open(c, lockfname, O_RDONLY, 
                                         DENY_NONE);
-                       msleep(10);
+                       smb_msleep(10);
                }
                if (fnum == -1) {
                        printf("second open read-only of %s failed (%s)\n",
@@ -4464,12 +4464,12 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
                                        printf("pid %d failed to start\n", (int)getpid());
                                        _exit(1);
                                }
-                               msleep(10);     
+                               smb_msleep(10); 
                        }
 
                        child_status[i] = getpid();
 
-                       while (child_status[i] && end_timer() < 5) msleep(2);
+                       while (child_status[i] && end_timer() < 5) smb_msleep(2);
 
                        child_status_out[i] = fn(i);
                        _exit(0);
@@ -4482,7 +4482,7 @@ static double create_procs(BOOL (*fn)(int), BOOL *result)
                        if (child_status[i]) synccount++;
                }
                if (synccount == nprocs) break;
-               msleep(10);
+               smb_msleep(10);
        } while (end_timer() < 30);
 
        if (synccount != nprocs) {