summaryrefslogtreecommitdiff
path: root/main/stdtime
AgeCommit message (Collapse)Author
2016-06-28BuildSystem: Fix a few issues hightlighted by gcc 6.xGeorge Joseph
gcc 6.1.1 caught a few more issues. Made sure the unit tests still pass for the func_env and stdtime issues. ASTERISK-26157 #close Change-Id: I6664d8f34a45bc1481d2a854481c7878b0c1cf8e
2015-12-28test_time: Provide a timeout when waiting.Joshua Colp
The test_timezone_watch unit test is written to expect a condition to be signaled when the inotify daemon thread runs. There exists a small window where the test_timezone_watch thread can signal the inotify daemon thread while it is not reading on the underlying file descriptor. If this occurs the test_timezone_watch thread will wait indefinitely for a signal that will never arrive. This change adds a timeout to the condition so it will return regardless after a period of time. Change-Id: Ifed981879df6de3d93acd3ee0a70f92546517390
2015-03-30main/stdtime/localtime: Fix warning introduced in r433720Matthew Jordan
The patch in r433720 caused a warning to be kicked back by gcc. It occurred due to this check in unistd.h: if (__nbytes > __bos0 (__buf)) return __read_chk_warn (__fd, __buf, __nbytes, __bos0 (__buf)); That is, if __nbytes is greater than the result of GCC's built-in object size for the struct, we'll kick back a warning. As it turns out, this is because there is an error in the code in the patch. We are passing the address of the pointer to the struct, not iev, which is a pointer to the struct. Hence, the number of bytes is probably going to be lot larger than the number of bytes that make up a pointer! This patch changes the code just read from the pointer to the struct - which fixes the warning. ASTERISK-24917 ........ Merged revisions 433743 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-30clang compiler warnings: Fix warning for -Wgnu-variable-sized-type-not-at-endMatthew Jordan
This patch fixes a warning caught by clang, wherein a variable sized struct is not located at the end of a struct. While the code in question actually expected this, this is a good warning to watch for. Hence, this patch refactors the code in question to not have two variable length elements in the same struct. Review: https://reviewboard.asterisk.org/r/4530/ ASTERISK-24917 Reported by: dkdegroot patches: rb4530.patch submitted by dkdegroot (License 6600) ........ Merged revisions 433717 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@433718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-10localtime: Fix file descriptor leak on kqueue(2) systemsMatthew Jordan
The localtime management in the Asterisk core contains a thread that watches for changes in the local timezone. On systems where the directory containing /etc/localtime is modified frequently, the thread monitoring the changes will be woken up to determine if any changes in timezone have occurred. When using kqueue(2), this can cause a leak of file descriptors due to some improper management of resources. This patch updates the kqueue(2) handling in localtime, such that is no longer leaks resources. Review: https://reviewboard.asterisk.org/r/4450/ ASTERISK-24739 #close Reported by: Ed Hynan patches: 11.15.0-u.diff uploaded by Ed Hynan (Licnese 6680) 11.7.0-u.diff uploaded by Ed Hynan (License 6680) svn-trunk-Jan-26-2015-u.diff uploaded by Ed Hynan (License 6680) ........ Merged revisions 432691 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-05-09Allow Asterisk to compile under GCC 4.10Kinsey Moore
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28Fix some uninitialized buffers for CDR handling valgrind found.Richard Mudgett
* Made ast_strftime_locale() ensure that the output buffer is initialized. The std library strftime() returns 0 and does not touch the buffer if it has an error. However, the function can also return 0 without an error. (closes issue ASTERISK-22412) Reported by: rmudgett ........ Merged revisions 397902 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-03Cleanup core main on exit.Richard Mudgett
* Cleanup time zones on exit. * Make exit clean/unclean report consistent for AMI and CLI in really_quit(). (issue ASTERISK-20649) Reported by: Corey Farrell Patches: core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell Modified ........ Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 377136 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377137 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15Multiple revisions 369001-369002Kevin P. Fleming
........ r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines Add support-level indications to many more source files. Since we now have tools that scan through the source tree looking for files with specific support levels, we need to ensure that every file that is a component of a 'core' or 'extended' module (or the main Asterisk binary) is explicitly marked with its support level. This patch adds support-level indications to many more source files in tree, but avoids adding them to third-party libraries that are included in the tree and to source files that don't end up involved in Asterisk itself. ........ r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines Add a script to enable finding source files without support-levels defined. ........ Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19Fix a variety of potential buffer overflowsMatthew Jordan
* chan_mobile: Fixed an overrun where the cind_state buffer (an integer array of size 16) would be overrun due to improper bounds checking. At worst, the buffer can be overrun by a total of 48 bytes (assuming 4-byte integers), which would still leave it within the allocated memory of struct hfp. This would corrupt other elements in that struct but not necessarily cause any further issues. * app_sms: The array imsg is of size 250, while the array (ud) that the data is copied into is of size 160. If the size of the inbound message is greater then 160, up to 90 bytes could be overrun in ud. This would corrupt the user data header (array udh) adjacent to ud. * chan_unistim: A number of invalid memmoves are corrected. These would move data (which may or may not be valid) into the ends of these buffers. * asterisk: ast_console_toggle_loglevel does not check that the console log level being set is less then or equal to the allowed log levels of 32. * format_pref: In ast_codec_pref_prepend, if any occurrence of the specified codec is not found, the value used to index into the array pref->order would be one greater then the maximum size of the array. * jitterbuf: If the element being placed into the jitter buffer lands in the last available slot in the jitter history buffer, the insertion sort attempts to move the last entry in the buffer into one slot past the maximum length of the buffer. Note that this occurred for both the min and max jitter history buffers. * tdd: If a read from fsk_serial returns a character that is greater then 32, an attempt to read past one of the statically defined arrays containing the values that character maps to would occur. * localtime: struct ast_time and tm are not the same size - ast_time is larger, although it contains the elements of tm within it in the same layout. Hence, when using memcpy to copy the contents of tm into ast_time, the size of tm should be used, as opposed to the size of ast_time. * extconf: this treats ast_timing's minmask array as if it had a length of 48, when it has defined the size of the array as 24. pbx.h defines minmask as having a size of 48. (issue ASTERISK-19668) Reported by: Matt Jordan ........ Merged revisions 362485 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 362496 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22Kill off red blobs in most of main/*Kinsey Moore
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Re-commit the verbose branch.Tilghman Lesher
This change permits each verbose destination (consoles, logger) to have its own concept of what the verbosity level is. The big feature here is that the logger will now be able to capture a particular verbosity level without condemning each console to need to suffer that level of verbosity. Additionally, a stray 'core set verbose' will no longer change what will go to the log. Review: https://reviewboard.asterisk.org/r/1599/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14Merged revisions 291791 via svnmerge from Jeff Peeler
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r291791 | jpeeler | 2010-10-14 13:45:02 -0500 (Thu, 14 Oct 2010) | 10 lines Add missing ifdefs for test framework and new locale code. (closes issue #18137) Reported by: ovi Patches: 18137_test_framework_ifdef.patch uploaded by wdoekes (license 717) 18137_localelist_warning.patch uploaded by wdoekes (license 717) Tested by: ovi ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-30Merged revisions 289543,289581 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r289543 | tilghman | 2010-09-30 12:50:52 -0500 (Thu, 30 Sep 2010) | 2 lines More Solaris compatibility fixes ........ r289581 | tilghman | 2010-09-30 15:23:10 -0500 (Thu, 30 Sep 2010) | 2 lines Solaris fixes. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-01Support setting locale per-mailbox (changes date/time languages for email, ↵Tilghman Lesher
pager messages). (closes issue #14333) Reported by: klaus3000 Patches: 20090515__issue14333.diff.txt uploaded by tilghman (license 14) app_voicemail.c-svn-trunk-rev211675-patch.txt uploaded by klaus3000 (license 65) Tested by: klaus3000 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13Fix build on linux.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-13Add kqueue(2) implementation to Asterisk in various places.Tilghman Lesher
This will save a considerable amount of CPU on the BSDs, including Mac OS X, as it eliminates several places in the code that we previously used a busy loop. Additionally, this adds a res_timing interface, using kqueue timers. Review: https://reviewboard.asterisk.org/r/543/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20Resolve more compiler warnings on FreeBSD.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-18Just in case of a race, send the signal on interrupt.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16Fix test_time on Mac OS X (and other platforms without inotify)Tilghman Lesher
Reviewboard: https://reviewboard.asterisk.org/r/554/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08Remove portions that weren't meant to be committed for the OS X compat fixTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08Change needed to make Mac OS X 10.6 happyTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20Use nanosleep instead of poll.Tilghman Lesher
This is not just because mmichelson suggested it, but also because Mac OS X puked on my poll(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03Compatibility fix for glibc 2.4Tilghman Lesher
(Closes issue #14820) Reported by: phsultan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25Picky, picky buildbotsTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25Use notification when timezone files change and re-scan then.Tilghman Lesher
(closes issue #14300) Reported by: jamessan Patches: 20090127__bug14300.diff.txt uploaded by tilghman (license 14) 20090224__bug14300.diff uploaded by jamessan (license 246) Tested by: jamessan Review: http://reviewboard.digium.com/r/136/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20Merged revisions 157859 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r157859 | kpfleming | 2008-11-19 15:34:47 -0600 (Wed, 19 Nov 2008) | 7 lines the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems. with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course). while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-01Add schedule extensions to app_meetme. In addition, the reporter found aTilghman Lesher
problem within strptime(3), which we are correcting here with ast_strptime(). (closes issue #11040) Reported by: DEA Patches: 20080910__bug11040.diff.txt uploaded by Corydon76 (license 14) Tested by: DEA git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27Merged revisions 144924-144925 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r144924 | kpfleming | 2008-09-27 10:00:48 -0500 (Sat, 27 Sep 2008) | 6 lines improve header inclusion process in a few small ways: - it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled - simplify the usage of some of these headers in the AEL-related stuff in the utils directory ........ r144925 | kpfleming | 2008-09-27 10:13:30 -0500 (Sat, 27 Sep 2008) | 2 lines fix some minor issues with rev 144924 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@144949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-20Merged revisions 103845 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r103845 | tilghman | 2008-02-20 11:53:00 -0600 (Wed, 20 Feb 2008) | 7 lines Compat fix for Solaris (closes issue #12022) Reported by: asgaroth Patches: 20080219__bug12022.diff.txt uploaded by Corydon76 (license 14) Tested by: asgaroth ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09Added a new module, res_phoneprov, which allows auto-provisioning of phonesTerry Wilson
based on configuration templates that use Asterisk dialplan function and variable substitution. It should be possible to create phone profiles and templates that work for the majority of phones provisioned over http. It is currently only intended to provision a single user account per phone. An example profile and set of templates for Polycom phones is provided. NOTE: Polycom firmware is not included, but should be placed in AST_DATA_DIR/phoneprov/configs to match up with the included templates. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16Merged revisions 85921 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85921 | tilghman | 2007-10-16 14:41:40 -0500 (Tue, 16 Oct 2007) | 4 lines Also set up gmtoff (this is used in the %z gnu extension to strftime) Reported and fixed by jcmoore Closes issue #11002 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17Merged revisions 82676 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82676 | russell | 2007-09-17 15:16:25 -0500 (Mon, 17 Sep 2007) | 4 lines Put a memset in ast_localtime() instead of a couple places in app_voicemail to prevent the problem everywhere instead of just a couple of places. (related to issue #10746) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12Merged revisions 82291 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82291 | tilghman | 2007-09-12 16:28:33 -0500 (Wed, 12 Sep 2007) | 2 lines Oops, wrong location for FreeBSD zone files ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12Merged revisions 82285 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82285 | tilghman | 2007-09-12 15:12:06 -0500 (Wed, 12 Sep 2007) | 4 lines Working on issue #10531 exposed a rather nasty 64-bit issue on ast_mktime, so we updated the localtime.c file from source. Next we'll have to write ast_strptime to match. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18Merge in ast_strftime branch, which changes timestamps to be accurate to the ↵Tilghman Lesher
microsecond, instead of only to the second git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Merged revisions 69392 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r69392 | kpfleming | 2007-06-14 16:50:40 -0500 (Thu, 14 Jun 2007) | 2 lines use ast_localtime() in every place localtime_r() was being used ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18Merged revisions 51256 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r51256 | tilghman | 2007-01-18 15:14:24 -0600 (Thu, 18 Jan 2007) | 10 lines Merged revisions 51255 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r51255 | tilghman | 2007-01-18 15:11:34 -0600 (Thu, 18 Jan 2007) | 2 lines If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-22Merged revisions 48906 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r48906 | qwell | 2006-12-22 16:33:46 -0600 (Fri, 22 Dec 2006) | 2 lines Minor fixes for Solaris. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-16Merged revisions 48521 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r48521 | kpfleming | 2006-12-16 14:12:41 -0600 (Sat, 16 Dec 2006) | 2 lines since we really, really have to have autoconfig.h included before all other headers (especially system headers), the Makefile will now force it to happen (this will fix build problems with files like ast_expr2f.c, where we can't control the inclusion order in the file itself) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21merge new_loader_completion branch, including (at least):Kevin P. Fleming
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3