]> granicus.if.org Git - mutt/commitdiff
A slightly extended version of Dave Ewart's sleeptime patch.
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 10 May 2001 08:02:18 +0000 (08:02 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 10 May 2001 08:02:18 +0000 (08:02 +0000)
27 files changed:
copy.c
curs_main.c
globals.h
hook.c
imap/auth_anon.c
imap/auth_cram.c
imap/auth_gss.c
imap/auth_login.c
imap/auth_sasl.c
imap/browse.c
imap/command.c
imap/imap.c
imap/message.c
imap/util.c
init.h
mbox.c
menu.c
mutt_socket.c
mutt_ssl.c
muttlib.c
mx.c
pgpkey.c
pop.c
pop_auth.c
pop_lib.c
protos.h
sort.c

diff --git a/copy.c b/copy.c
index 87c7a60928bd0fe04ce746613c81e629c0e901c9..7e590838bd0294deea8d0853bde0a03644247b53 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -479,7 +479,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
        {
          mutt_error ("The length calculation was wrong by %ld bytes", fail);
          new_length += fail;
-         sleep (5);
+         mutt_sleep (1);
        }
       }
 #endif
index b28d9c50285894d24e14e24b58c93a9e9d081290..c2ccc647d4c8be628c15226054e3ad5fccf1ddd2 100644 (file)
@@ -983,8 +983,8 @@ int mutt_index_menu (void)
          safe_free ((void **) &Context);
        }
 
-       sleep (1); /* give a second to read the mailbox status */
-
+        mutt_sleep (0);
+      
        mutt_folder_hook (buf);
 
        if ((Context = mx_open_mailbox (buf, 
index 5697061ead1a845a6064f969e4f6eb910c5585e7..1888d44686915ee3b10331347f6927cdbdda5a5c 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -137,6 +137,7 @@ WHERE short PagerContext;
 WHERE short PagerIndexLines;
 WHERE short ReadInc;
 WHERE short SendmailWait;
+WHERE short SleepTime INITVAL (1);
 WHERE short Timeout;
 WHERE short WriteInc;
 WHERE short ScoreThresholdDelete;
diff --git a/hook.c b/hook.c
index bd41e0817ff1c8a0cac084a7a228c8704d89589b..3e3588c7452e4ddc7aba8acdd50f6dd666d93cfa 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -292,7 +292,7 @@ void mutt_folder_hook (char *path)
        {
          mutt_error ("%s", err.data);
          FREE (&token.data);
-         sleep (1);    /* pause a moment to let the user see the error */
+         mutt_sleep (1);       /* pause a moment to let the user see the error */
          current_hook_type = 0;
          return;
        }
@@ -339,7 +339,7 @@ void mutt_message_hook (CONTEXT *ctx, HEADER *hdr, int type)
        {
          FREE (&token.data);
          mutt_error ("%s", err.data);
-         sleep (1);
+         mutt_sleep (1);
          current_hook_type = 0;
          return;
        }
index 78d6f932042aba3cfc3491b20d2b374f477db237..7d60e017b57fcdf132232e4751dbc761929d8c29 100644 (file)
@@ -67,6 +67,6 @@ imap_auth_res_t imap_auth_anon (IMAP_DATA* idata)
 
  bail:
   mutt_error _("Anonymous authentication failed.");
-  sleep (2);
+  mutt_sleep (2);
   return IMAP_AUTH_FAILURE;
 }
index 07bf6e897a9f1b4f15a86cea8c93816fb330a4a1..741e26c66ceec24245b3072977774df331680b6e 100644 (file)
@@ -122,7 +122,7 @@ imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata)
 
  bail:
   mutt_error _("CRAM-MD5 authentication failed.");
-  sleep (2);
+  mutt_sleep (2);
   return IMAP_AUTH_FAILURE;
 }
 
index 1cc466418bfc8c95906388e878fd8976568c5c00..a269230c8ac411bdcda3983eed6d704f6540f18d 100644 (file)
@@ -260,6 +260,6 @@ imap_auth_res_t imap_auth_gss (IMAP_DATA* idata)
 
  bail:
   mutt_error _("GSSAPI authentication failed.");
-  sleep (2);
+  mutt_sleep (2);
   return IMAP_AUTH_FAILURE;
 }
index 212d7fdef596c9c66eef7dbf14842a9949168f37..9bdbb9fe0c677395d17b56cd5806321f46dce271 100644 (file)
@@ -61,6 +61,6 @@ imap_auth_res_t imap_auth_login (IMAP_DATA* idata)
     return IMAP_AUTH_SUCCESS;
 
   mutt_error _("Login failed.");
-  sleep (2);
+  mutt_sleep (2);
   return IMAP_AUTH_FAILURE;
 }
index 75d0659cab173c848ce071d1a7c670ebb5b30708..7eb78131c8b600bbcfd857de18f88e780c36f638 100644 (file)
@@ -162,7 +162,7 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA* idata)
 
  bail:
   mutt_error _("SASL authentication failed.");
-  sleep(2);
+  mutt_sleep(2);
   sasl_dispose (&saslconn);
 
   return IMAP_AUTH_FAILURE;
index 2ed91a06fb775506a822b8a7023375e2e84326b3..284ba2ddacbd66403b1c66efd830fe6de4298235 100644 (file)
@@ -270,7 +270,7 @@ int imap_mailbox_create (const char* folder)
     goto fail;
 
   mutt_message _("Mailbox created.");
-  sleep (1);
+  mutt_sleep (0);
 
   FREE (&mx.mbox);
   return 0;
index 32a6405a526a8bd71b05c6041ff5e80694c23050..61dd622bd1e85890e3381b3567456807cbc80960 100644 (file)
@@ -216,7 +216,7 @@ int imap_exec (IMAP_DATA* idata, const char* cmd, int flags)
     pc = idata->cmd.buf;
     pc = imap_next_word (pc);
     mutt_error ("%s", pc);
-    sleep (2);
+    mutt_sleep (2);
 
     return -1;
   }
@@ -368,7 +368,7 @@ static int cmd_handle_untagged (IMAP_DATA* idata)
 
     /* Display the warning message from the server */
     mutt_error ("%s", s+3);
-    sleep (2);
+    mutt_sleep (2);
   }
 
   return 0;
index b073d51ca6f74bbe42596228d7a0b02f8c11c276..0be0040cdd06f3677c5421d3580e93b14b54a440 100644 (file)
@@ -292,7 +292,7 @@ static int imap_check_capabilities (IMAP_DATA* idata)
       ||mutt_bit_isset(idata->capabilities,IMAP4REV1)))
   {
     mutt_error _("This IMAP server is ancient. Mutt does not work with it.");
-    sleep (5); /* pause a moment to let the user see the error */
+    mutt_sleep (5);    /* pause a moment to let the user see the error */
 
     return -1;
   }
@@ -361,7 +361,7 @@ int imap_open_connection (IMAP_DATA* idata)
   if (mutt_socket_open (idata->conn) < 0)
   {
     mutt_error (_("Connection to %s failed."), idata->conn->account.host);
-    sleep (1);
+    mutt_sleep (1);
     return -1;
   }
 
@@ -390,7 +390,7 @@ int imap_open_connection (IMAP_DATA* idata)
          if (mutt_ssl_starttls (idata->conn))
          {
            mutt_error ("Could not negotiate TLS connection");
-           sleep (1);
+           mutt_sleep (1);
            goto bail;
          }
          else
@@ -593,7 +593,7 @@ int imap_open_mailbox (CONTEXT* ctx)
     s = imap_next_word (idata->cmd.buf); /* skip seq */
     s = imap_next_word (s); /* Skip response */
     mutt_error ("%s", s);
-    sleep (2);
+    mutt_sleep (2);
     goto fail;
   }
 
index a76aa213e1d34caf6da5fb3e245ded4bca3ae7e5..ff70ca7cdeed2a31178a5f2d1a71fd5930d95a47 100644 (file)
@@ -72,7 +72,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend)
   else
   {    /* Unable to fetch headers for lower versions */
     mutt_error _("Unable to fetch headers from this IMAP server version.");
-    sleep (2); /* pause a moment to let the user see the error */
+    mutt_sleep (2);    /* pause a moment to let the user see the error */
     return -1;
   }
 
@@ -476,7 +476,7 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg)
     SKIPWS (pc);
     pc = imap_next_word (pc);
     mutt_error ("%s", pc);
-    sleep (1);
+    mutt_sleep (1);
     fclose (fp);
     goto fail;
   }
@@ -514,7 +514,7 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg)
     SKIPWS (pc);
     pc = imap_next_word (pc);
     mutt_error ("%s", pc);
-    sleep (1);
+    mutt_sleep (1);
     goto fail;
   }
 
index e76d551f59c72c623ff35f137fa147be7012656c..97a0bce310cc5ee93b56501b91f199630cc97123 100644 (file)
@@ -219,7 +219,7 @@ int imap_continue (const char* msg, const char* resp)
 void imap_error (const char *where, const char *msg)
 {
   mutt_error (_("%s [%s]\n"), where, msg);
-  sleep (2);
+  mutt_sleep (2);
 }
 
 /* imap_new_idata: Allocate and initialise a new IMAP_DATA structure.
diff --git a/init.h b/init.h
index 87298215ac7e36a01e7ffcbc70d6feaaf541c859..0e44e17645b731a5f109700669cd65fcba33feca 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1880,6 +1880,14 @@ struct option_t MuttVars[] = {
   ** positives of ``$$quote_regexp'', most notably smileys in the beginning
   ** of a line
   */
+  { "sleep_time",      DT_NUM, R_NONE, UL &SleepTime, 1 },
+  /*
+  ** .pp
+  ** Specifies time, in seconds, to pause while displaying certain informational
+  ** messages, while moving from folder to folder and after expunging
+  ** messages from the current folder.  The default is to pause one second, so 
+  ** a value of zero for this option suppresses the pause.
+  */
   { "sort",            DT_SORT, R_INDEX|R_RESORT, UL &Sort, SORT_DATE },
   /*
   ** .pp
diff --git a/mbox.c b/mbox.c
index bb008bf430cda9b814823eb7222042a556f91dea..08d1167dddc1cb96c3d87e16884a4b57a20025c2 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -732,7 +732,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
       unlink (tempfile);
     }
     mutt_error _("Could not create temporary file!");
-    sleep (5);
+    mutt_sleep (5);
     goto bail;
   }
 
@@ -749,7 +749,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
      * never happen, is we presume it is a bug in mutt.
      */
     mutt_error _("sync: mbox modified, but no modified messages! (report this bug)");
-    sleep(5); /* the mutt_error /will/ get cleared! */
+    mutt_sleep(5); /* the mutt_error /will/ get cleared! */
     dprint(1, (debugfile, "mbox_sync_mailbox(): no modified messages.\n"));
     unlink (tempfile);
     goto bail;
@@ -797,7 +797,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
        if (fputs (MMDF_SEP, fp) == EOF)
        {
          mutt_perror (tempfile);
-         sleep (5);
+         mutt_sleep (5);
          unlink (tempfile);
          goto bail;
        }
@@ -808,7 +808,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
        if (fputs (KENDRA_SEP, fp) == EOF)
        {
          mutt_perror (tempfile);
-         sleep (5);
+         mutt_sleep (5);
          unlink (tempfile);
          goto bail;
        }
@@ -823,7 +823,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
       if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE, CH_FROM | CH_UPDATE | CH_UPDATE_LEN) == -1)
       {
        mutt_perror (tempfile);
-       sleep (5);
+       mutt_sleep (5);
        unlink (tempfile);
        goto bail;
       }
@@ -843,7 +843,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
          if(fputs(MMDF_SEP, fp) == EOF) 
          {
            mutt_perror (tempfile);
-           sleep (5);
+           mutt_sleep (5);
            unlink (tempfile);
            goto bail; 
          }
@@ -852,7 +852,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
          if(fputs(KENDRA_SEP, fp) == EOF)
          {
            mutt_perror (tempfile);
-           sleep (5);
+           mutt_sleep (5);
            unlink (tempfile);
            goto bail;
          }
@@ -861,7 +861,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
          if(fputs("\n", fp) == EOF) 
          {
            mutt_perror (tempfile);
-           sleep (5);
+           mutt_sleep (5);
            unlink (tempfile);
            goto bail;
          }
@@ -875,7 +875,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
     dprint(1, (debugfile, "mbox_sync_mailbox: fclose() returned non-zero.\n"));
     unlink (tempfile);
     mutt_perror (tempfile);
-    sleep (5);
+    mutt_sleep (5);
     goto bail;
   }
   fp = NULL;
@@ -884,7 +884,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
   if (stat (ctx->path, &statbuf) == -1)
   {
     mutt_perror (ctx->path);
-    sleep (5);
+    mutt_sleep (5);
     unlink (tempfile);
     goto bail;
   }
@@ -895,7 +895,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
     mx_fastclose_mailbox (ctx);
     dprint (1, (debugfile, "mbox_sync_mailbox: unable to reopen temp copy of mailbox!\n"));
     mutt_perror (tempfile);
-    sleep (5);
+    mutt_sleep (5);
     return (-1);
   }
 
@@ -953,7 +953,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
     mx_fastclose_mailbox (ctx);
     mutt_pretty_mailbox (savefile);
     mutt_error (_("Write failed!  Saved partial mailbox to %s"), savefile);
-    sleep (5);
+    mutt_sleep (5);
     return (-1);
   }
 
diff --git a/menu.c b/menu.c
index 39e4d729139c9f18a471f4d7ec13e11913a7227d..19d36a5e713ced18865cc24c92e72edb85812bd0 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -340,7 +340,7 @@ void menu_redraw_prompt (MUTTMENU *menu)
   {
     if (option (OPTMSGERR)) 
     {
-      sleep (1);
+      mutt_sleep (1);
       unset_option (OPTMSGERR);
     }
 
index dd65b10ed3e317d6938c13352fb31ce4cc896f76..e628d65eb277e9b0741eefc1f0942539388a4591 100644 (file)
@@ -200,7 +200,7 @@ CONNECTION* mutt_conn_find (const CONNECTION* start, const ACCOUNT* account)
     mutt_nss_socket_setup (conn);
 #else
     mutt_error _("SSL is unavailable.");
-    sleep (2);
+    mutt_sleep (2);
     FREE (&conn);
 
     return NULL;
@@ -234,10 +234,10 @@ static int socket_connect (int fd, struct sockaddr* sa)
     dprint (1, (debugfile, "Preconnect result: %d\n", rc));
     if (rc)
     {
-       save_errno = errno;
-       mutt_perror (_("Preconnect command failed."));
-       sleep (1);
-
+      save_errno = errno;
+      mutt_perror (_("Preconnect command failed."));
+      mutt_sleep (1);
+      
       return save_errno;
     }
   }
index 6fe687a4a2cbd83fdb068336e8c0183a3bc47b6c..b6ac55945eeb117ccaa0de27cf2521956a18450a 100644 (file)
@@ -170,7 +170,7 @@ int ssl_init (void)
     if (! HAVE_ENTROPY())
     {
       mutt_error (_("Failed to find enough entropy on your system"));
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
   }
@@ -202,7 +202,7 @@ static int add_entropy (const char *file)
       ((st.st_mode & (S_IWOTH | S_IROTH)) != 0))
   {
     mutt_error (_("%s has insecure permissions!"), file);
-    sleep (2);
+    mutt_sleep (2);
     return -1;
   }
 
@@ -221,7 +221,7 @@ static int add_entropy (const char *file)
 static int ssl_socket_open_err (CONNECTION *conn)
 {
   mutt_error (_("SSL disabled due the lack of entropy"));
-  sleep (2);
+  mutt_sleep (2);
   return -1;
 }
 
@@ -324,7 +324,7 @@ int ssl_negotiate (sslsockdata* ssldata)
     }
     
     mutt_error ("SSL failed: %s", errmsg);
-    sleep (1);
+    mutt_sleep (1);
 
     return -1;
   }
@@ -333,7 +333,7 @@ int ssl_negotiate (sslsockdata* ssldata)
   if (!ssldata->cert)
   {
     mutt_error (_("Unable to get certificate from peer"));
-    sleep (1);
+    mutt_sleep (1);
     return -1;
   }
 
@@ -342,7 +342,7 @@ int ssl_negotiate (sslsockdata* ssldata)
 
   mutt_message (_("SSL connection using %s (%s)"), 
     SSL_get_cipher_version (ssldata->ssl), SSL_get_cipher_name (ssldata->ssl));
-  sleep (1);
+  mutt_sleep (0);
 
   return 0;
 }
@@ -489,14 +489,14 @@ static int check_certificate_by_digest (X509 *peercert)
   {
     dprint (2, (debugfile, "Server certificate is not yet valid\n"));
     mutt_error (_("Server certificate is not yet valid"));
-    sleep (2);
+    mutt_sleep (2);
     return 0;
   }
   if (X509_cmp_current_time (X509_get_notAfter (peercert)) <= 0)
   {
     dprint (2, (debugfile, "Server certificate has expired"));
     mutt_error (_("Server certificate has expired"));
-    sleep (2);
+    mutt_sleep (2);
     return 0;
   }
 
@@ -637,10 +637,15 @@ static int ssl_check_certificate (sslsockdata * data)
          fclose (fp);
        }
        if (!done)
+        {
          mutt_error (_("Warning: Couldn't save certificate"));
+         mutt_sleep (2);
+       }
        else
+        {
          mutt_message (_("Certificate saved"));
-       sleep (1);
+         mutt_sleep (0);
+       }
         /* fall through */
       case OP_MAX + 2:         /* accept once */
         done = 2;
index 4f89f089875fe448e65d364fd03fa7ec3354aaf9..d973514fa97f6dabef2d70c067f954ab592f80ea 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1216,3 +1216,10 @@ void mutt_display_sanitize (char *s)
   }
 }
       
+void mutt_sleep (short s)
+{
+  if (SleepTime > s)
+    sleep (SleepTime);
+  else if (s)
+    sleep (s);
+}
diff --git a/mx.c b/mx.c
index e591e0e27c35e86c147050eab9e1903259fbad6b..786887f070a0dee5ebf062102468e55fba23798e 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1175,8 +1175,8 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint)
     mutt_message (_("%d kept, %d deleted."), msgcount - deleted,
       deleted);
 
-    sleep (1); /* allow the user time to read the message */
-
+    mutt_sleep (0);
+    
     if (ctx->msgcount == ctx->deleted &&
        (ctx->magic == M_MBOX || ctx->magic == M_MMDF) &&
        !mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY))
index bfc6ff82bec429512df754ada21b229a7d0529a9..fa40fea12f8a5d62f81e4e653405d895d152ab4a 100644 (file)
--- a/pgpkey.c
+++ b/pgpkey.c
@@ -484,7 +484,7 @@ static pgp_key_t *pgp_select_key (pgp_key_t *keys,
   if (!i && unusable)
   {
     mutt_error _("All matching keys are marked expired/revoked.");
-    sleep (1);
+    mutt_sleep (1);
     return NULL;
   }
 
diff --git a/pop.c b/pop.c
index ac3f5ddda850c29d84ce28f8cb00d03720623513..dba20846e44d832a6a2854815f9966dfa55556db 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -240,7 +240,7 @@ int pop_open_mailbox (CONTEXT *ctx)
   if (pop_parse_path (ctx->path, &acct))
   {
     mutt_error ("%s is an invalid POP path", ctx->path);
-    sleep (2);
+    mutt_sleep (2);
     return -1;
   }
 
@@ -276,7 +276,7 @@ int pop_open_mailbox (CONTEXT *ctx)
 
     if (ret < -1)
     {
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
   }
@@ -351,7 +351,7 @@ int pop_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno)
        return 0;
 
       mutt_perror (cache->path);
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
     else
@@ -371,7 +371,7 @@ int pop_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno)
     if (h->refno < 0)
     {
       mutt_error _("The message index is incorrect. Try reopening the mailbox.");
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
 
@@ -382,7 +382,7 @@ int pop_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno)
     if (!msg->fp)
     {
       mutt_perror (path);
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
 
@@ -398,14 +398,14 @@ int pop_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno)
     if (ret == -2)
     {
       mutt_error ("%s", pop_data->err_msg);
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
 
     if (ret == -3)
     {
       mutt_error _("Can't write message to temporary file!");
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
   }
@@ -483,7 +483,7 @@ int pop_sync_mailbox (CONTEXT *ctx, int *index_hint)
     if (ret == -2)
     {
       mutt_error ("%s", pop_data->err_msg);
-      sleep (2);
+      mutt_sleep (2);
       return -1;
     }
   }
index 09ec5e727fdb28d6ab77e9a89ccf9d4c7b3180e9..2df92212e15a82e28f0d3f09a393a2c112f15f6e 100644 (file)
@@ -152,7 +152,7 @@ bail:
   }
 
   mutt_error _("SASL authentication failed.");
-  sleep (2);
+  mutt_sleep (2);
 
   if (rc == SASL_OK)
     return POP_A_FAILURE;
@@ -212,7 +212,7 @@ static pop_auth_res_t pop_auth_apop (POP_DATA *pop_data)
   }
 
   mutt_error _("APOP authentication failed.");
-  sleep (2);
+  mutt_sleep (2);
 
   return POP_A_SKIP;
 }
@@ -270,7 +270,7 @@ static pop_auth_res_t pop_auth_user (POP_DATA *pop_data)
   }
 
   mutt_error ("%s %s", _("Login failed."), pop_data->err_msg);
-  sleep (2);
+  mutt_sleep (2);
 
   return POP_A_FAILURE;
 }
index 6cbf1eb2bed80cad41f5db0bc34a54c91526dcde..b38d7d05d49c9ad667228c0fd46e59e09db1e0f4 100644 (file)
--- a/pop_lib.c
+++ b/pop_lib.c
@@ -235,7 +235,7 @@ int pop_open_connection (POP_DATA *pop_data)
   ret = pop_connect (pop_data);
   if (ret < 0)
   {
-    sleep (2);
+    mutt_sleep (2);
     return ret;
   }
 
@@ -244,7 +244,7 @@ int pop_open_connection (POP_DATA *pop_data)
     goto err_conn;
   if (ret == -2)
   {
-    sleep (2);
+    mutt_sleep (2);
     return -2;
   }
 
@@ -262,7 +262,7 @@ int pop_open_connection (POP_DATA *pop_data)
   if (ret == -2)
   {
     mutt_error ("%s", pop_data->err_msg);
-    sleep (2);
+    mutt_sleep (2);
     return ret;
   }
 
@@ -272,7 +272,7 @@ int pop_open_connection (POP_DATA *pop_data)
 err_conn:
   pop_data->status = POP_DISCONNECTED;
   mutt_error _("Server closed connection!");
-  sleep (2);
+  mutt_sleep (2);
   return -1;
 }
 
@@ -462,7 +462,7 @@ int pop_reconnect (CONTEXT *ctx)
       if (ret == -2)
       {
         mutt_error ("%s", pop_data->err_msg);
-        sleep (2);
+        mutt_sleep (2);
       }
     }
     if (ret == 0)
index a221e5f64032ae36e8539eacfa2db01396060dbb..0923589c8965c70f45def9e96455a3044ed5eed2 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -320,6 +320,7 @@ int mutt_write_mime_header (BODY *, FILE *);
 int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int);
 int mutt_yesorno (const char *, int);
 void mutt_set_header_color(CONTEXT *, HEADER *);
+void mutt_sleep (short);
 int mutt_save_confirm (const char  *, struct stat *);
 
 int mh_valid_message (const char *);
diff --git a/sort.c b/sort.c
index 7fd4633d976f1637d7b763d3994bece5fa6ffa01..9c5c0a451e0f6af7106c89eabdc94ebb0f2659ee 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -230,7 +230,7 @@ void mutt_sort_headers (CONTEXT *ctx, int init)
           (AuxSort = mutt_get_sort_func (SortAux)) == NULL)
   {
     mutt_error _("Could not find sorting function! [report this bug]");
-    sleep (1);
+    mutt_sleep (1);
     return;
   }
   else