]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix showing of swap details when sysinfo() is available 13/3913/1
authorTimo Teräs <timo.teras@iki.fi>
Fri, 9 Sep 2016 11:35:43 +0000 (14:35 +0300)
committerJoshua Colp <jcolp@digium.com>
Fri, 16 Sep 2016 13:58:41 +0000 (08:58 -0500)
commit1e9ae453fdf9b2a426ebb673ad56d696d74dd502
tree0bd15775e5f41c6b989a569b05b4b2bd6f44dc39
parent58f41ebf934e3f7eb7d810ea34bb778c68e2861d
Fix showing of swap details when sysinfo() is available

If sysinfo() is available, but not sysctl() or swapctl() the
printing code for swap buffer sizes is incorrectly omitted.
The above condition happens with musl c-library.

Fix #if rule to consider defined(HAVE_SYSINFO). And also
remove the redundant || defined(HAVE_SYSCTL) which was
incorrectly there to start with. Now swap information is
displayed only if an actual libc function to get it is
available.

This also fixes warnings previously seen with musl libc:

   [CC] asterisk.c -> asterisk.o
asterisk.c: In function 'handle_show_sysinfo':
asterisk.c:773:6: warning: variable 'totalswap' set but not used
 [-Wunused-but-set-variable]
  int totalswap = 0;
      ^~~~~~~~~
asterisk.c:770:11: warning: variable 'freeswap' set but not used
 [-Wunused-but-set-variable]
  uint64_t freeswap = 0;
           ^~~~~~~~

Change-Id: I1fb21dad8f27e416c60f138c6f2bff03fb626eca
main/asterisk.c