[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select 906b8fb 048/218: Port to NetBSD tzallo
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select 906b8fb 048/218: Port to NetBSD tzalloc |
Date: |
Fri, 14 Dec 2018 03:34:53 -0500 (EST) |
branch: feature/gnus-select
commit 906b8fb360cc8ccb821a2d6cb05bcb8d7e096ca8
Author: Paul Eggert <address@hidden>
Commit: Andrew G Cohen <address@hidden>
Port to NetBSD tzalloc
Problem reported by Valery Ushakov (Bug#30738).
* src/editfns.c (xtzalloc): Remove.
(invalid_time_zone_specification): New function.
(tzlookup): Port to NetBSD, where tzalloc can fail when the TZ
string has an invalid value.
---
src/editfns.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/src/editfns.c b/src/editfns.c
index 3a34dd0..debe105 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -117,14 +117,10 @@ emacs_mktime_z (timezone_t tz, struct tm *tm)
return t;
}
-/* Allocate a timezone, signaling on failure. */
-static timezone_t
-xtzalloc (char const *name)
+static _Noreturn void
+invalid_time_zone_specification (Lisp_Object zone)
{
- timezone_t tz = tzalloc (name);
- if (!tz)
- memory_full (SIZE_MAX);
- return tz;
+ xsignal2 (Qerror, build_string ("Invalid time zone specification"), zone);
}
/* Free a timezone, except do not free the time zone for local time.
@@ -205,9 +201,15 @@ tzlookup (Lisp_Object zone, bool settz)
}
}
else
- xsignal2 (Qerror, build_string ("Invalid time zone specification"),
- zone);
- new_tz = xtzalloc (zone_string);
+ invalid_time_zone_specification (zone);
+
+ new_tz = tzalloc (zone_string);
+ if (!new_tz)
+ {
+ if (errno == ENOMEM)
+ memory_full (SIZE_MAX);
+ invalid_time_zone_specification (zone);
+ }
}
if (settz)
- [Emacs-diffs] feature/gnus-select 954d7ce 035/218: * test/Makefile.in (check-declare): New PHONY rule., (continued)
- [Emacs-diffs] feature/gnus-select 954d7ce 035/218: * test/Makefile.in (check-declare): New PHONY rule., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 036f0fe 032/218: Fix string-to-number C-level mishandling, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 0160cc5 029/218: Avoid losing info when formatting integers, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5276bca 052/218: Make transpose-regions interactive (Bug#30343), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5400223 062/218: * lisp/vc/vc-dir.el (vc-dir-unmark): Fix documentation., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 71da4a5 063/218: ; * lisp/minibuffer.el (completion-cycle-threshold): Fix last change., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select fbe22b5 014/218: Replace some obsolete aliases in code, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 46738e3 040/218: Improve SVG documentation, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select d25b161 042/218: Fix wrong behavior of 'outline-headers-as-kill' command (Bug#30209), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 064037f 050/218: * lisp/simple.el (mark-whole-buffer): Clarify its behavior., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 906b8fb 048/218: Port to NetBSD tzalloc,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select fd1f96f 060/218: Replace use of the obsolete write-contents-hooks, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 7f35e7d 055/218: Improve documentation of Xref, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 2fe4ae7 057/218: Fix last change in Xref documentation, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b92cf09 065/218: Stop mentioning options.el in doc, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 2005a72 069/218: Avoid assertion violation under visual-order-cursor-movement, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select b405149 072/218: * src/xdisp.c (Fwindow_text_pixel_size): Fix last change., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select ea586a7 081/218: Fix problems caused by fontconfig-2.13.0, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 3b92c80 068/218: * lisp/subr.el (focus-frame, unfocus-frame): Remove obsolete no-ops., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 64c4ec0 082/218: More hydra.nixos.org logging for unfinished tests, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 066e71d 056/218: More changes in the Emacs manual, Andrew G Cohen, 2018/12/14