]> git.ipfire.org Git - thirdparty/asterisk.git/commit
test_json: Fix deprecation warnings
authorDavid M. Lee <dlee@digium.com>
Fri, 25 Oct 2013 13:48:40 +0000 (13:48 +0000)
committerDavid M. Lee <dlee@digium.com>
Fri, 25 Oct 2013 13:48:40 +0000 (13:48 +0000)
commite8b74d4d57e40156893c17ffb1581564856fcb7e
tree508626d9167222d2b8305c51d331cb4dbd383754
parent27334b90938ff6e20db5e0752c28c34d50f0053f
test_json: Fix deprecation warnings

After a series of upgrades over recent weeks, I've discovered that
test_json.c won't compile in dev mode any more for me.

One of gcc-4.8.2, OS X Mavericks or Xcode 5 has decided to deprecate
tempnam. Which, in general, is a good thing. But for test code that just
needs a temporary file, it's just annoying.

This patch replaces usage of tempname with mkstemp, avoiding the
deprecation warning. It also removes the temporary files when the test
is complete, which apparently we weren't doing before (oops).

Review: https://reviewboard.asterisk.org/r/2957/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@401872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
tests/test_json.c