aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorVibhav Pant2023-06-06 19:30:27 +0530
committerVibhav Pant2023-06-06 19:30:27 +0530
commit49ffcbf86a32a8a217538d4df3736fe069ccf35d (patch)
treea5f16157cc20fb19a844473a6fbd2b434f4c8260 /lib-src
parentaf569fa3d90a717983b743eb97adbf869c6d1736 (diff)
parent7ca1d782f5910d0c3978c6798a45c6854ec668c7 (diff)
downloademacs-49ffcbf86a32a8a217538d4df3736fe069ccf35d.tar.gz
emacs-49ffcbf86a32a8a217538d4df3736fe069ccf35d.zip
Merge branch 'master' into scratch/comp-static-data
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ebrowse.c5
-rw-r--r--lib-src/etags.c5
-rw-r--r--lib-src/movemail.c5
-rw-r--r--lib-src/update-game-score.c6
4 files changed, 11 insertions, 10 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 371fa6c938b..4b71f7447e0 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -3767,8 +3767,9 @@ main (int argc, char **argv)
3767 if (n_input_files == input_filenames_size) 3767 if (n_input_files == input_filenames_size)
3768 { 3768 {
3769 input_filenames_size = max (10, 2 * input_filenames_size); 3769 input_filenames_size = max (10, 2 * input_filenames_size);
3770 input_filenames = (char **) xrealloc ((void *)input_filenames, 3770 input_filenames = xrealloc (input_filenames,
3771 input_filenames_size); 3771 (input_filenames_size
3772 * sizeof *input_filenames));
3772 } 3773 }
3773 input_filenames[n_input_files++] = xstrdup (optarg); 3774 input_filenames[n_input_files++] = xstrdup (optarg);
3774 break; 3775 break;
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 2c6b4e7a630..147ecbd7c1b 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -109,6 +109,7 @@ University of California, as described above. */
109#include <limits.h> 109#include <limits.h>
110#include <unistd.h> 110#include <unistd.h>
111#include <stdarg.h> 111#include <stdarg.h>
112#include <stdckdint.h>
112#include <stdlib.h> 113#include <stdlib.h>
113#include <string.h> 114#include <string.h>
114#include <sysstdio.h> 115#include <sysstdio.h>
@@ -8038,7 +8039,7 @@ xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size)
8038 ptrdiff_t nbytes; 8039 ptrdiff_t nbytes;
8039 assume (0 <= nitems); 8040 assume (0 <= nitems);
8040 assume (0 < item_size); 8041 assume (0 < item_size);
8041 if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes)) 8042 if (ckd_mul (&nbytes, nitems, item_size))
8042 memory_full (); 8043 memory_full ();
8043 return xmalloc (nbytes); 8044 return xmalloc (nbytes);
8044} 8045}
@@ -8049,7 +8050,7 @@ xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size)
8049 ptrdiff_t nbytes; 8050 ptrdiff_t nbytes;
8050 assume (0 <= nitems); 8051 assume (0 <= nitems);
8051 assume (0 < item_size); 8052 assume (0 < item_size);
8052 if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes) || SIZE_MAX < nbytes) 8053 if (ckd_mul (&nbytes, nitems, item_size) || SIZE_MAX < nbytes)
8053 memory_full (); 8054 memory_full ();
8054 void *result = realloc (pa, nbytes); 8055 void *result = realloc (pa, nbytes);
8055 if (!result) 8056 if (!result)
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 8119046a916..6a772e9043e 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -62,6 +62,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
62#include <stdlib.h> 62#include <stdlib.h>
63#include <errno.h> 63#include <errno.h>
64#include <time.h> 64#include <time.h>
65#include <timespec.h>
65 66
66#include <getopt.h> 67#include <getopt.h>
67#include <unistd.h> 68#include <unistd.h>
@@ -469,7 +470,7 @@ main (int argc, char **argv)
469 that were set on the file. Better to just empty the file. */ 470 that were set on the file. Better to just empty the file. */
470 if (unlink (inname) < 0 && errno != ENOENT) 471 if (unlink (inname) < 0 && errno != ENOENT)
471#endif /* MAIL_UNLINK_SPOOL */ 472#endif /* MAIL_UNLINK_SPOOL */
472 creat (inname, 0600); 473 close (creat (inname, 0600));
473 } 474 }
474#endif /* not MAIL_USE_SYSTEM_LOCK */ 475#endif /* not MAIL_USE_SYSTEM_LOCK */
475 476
@@ -846,7 +847,7 @@ movemail_strftime (char *s, size_t size, char const *format,
846static bool 847static bool
847mbx_delimit_begin (FILE *mbf) 848mbx_delimit_begin (FILE *mbf)
848{ 849{
849 time_t now = time (NULL); 850 time_t now = current_timespec ().tv_sec;
850 struct tm *ltime = localtime (&now); 851 struct tm *ltime = localtime (&now);
851 if (!ltime) 852 if (!ltime)
852 return false; 853 return false;
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 83167f59b8a..4592e14d1d6 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -185,8 +185,6 @@ main (int argc, char **argv)
185 ptrdiff_t scorecount, scorealloc; 185 ptrdiff_t scorecount, scorealloc;
186 ptrdiff_t max_scores = MAX_SCORES; 186 ptrdiff_t max_scores = MAX_SCORES;
187 187
188 srand (time (0));
189
190 while ((c = getopt (argc, argv, "hrm:d:")) != -1) 188 while ((c = getopt (argc, argv, "hrm:d:")) != -1)
191 switch (c) 189 switch (c)
192 { 190 {
@@ -485,8 +483,8 @@ lock_file (const char *filename, void **state)
485 return -1; 483 return -1;
486 attempts = 0; 484 attempts = 0;
487 } 485 }
488 486 else
489 sleep ((rand () & 1) + 1); 487 sleep (1);
490 } 488 }
491 489
492 close (fd); 490 close (fd);