]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Add a new syntax-check rule for gethostname.
authorChris Lalancette <clalance@redhat.com>
Fri, 23 Oct 2009 10:13:20 +0000 (12:13 +0200)
committerChris Lalancette <clalance@redhat.com>
Mon, 26 Oct 2009 09:34:27 +0000 (10:34 +0100)
We should always be using virGetHostname in place of
gethostname; thus add in a new syntax-check rule to make
sure no new uses creep in.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
.x-sc_prohibit_gethostname [new file with mode: 0644]
Makefile.am
cfg.mk
src/libvirt.c

diff --git a/.x-sc_prohibit_gethostname b/.x-sc_prohibit_gethostname
new file mode 100644 (file)
index 0000000..e7acb03
--- /dev/null
@@ -0,0 +1,2 @@
+^src/util/util\.c$
+^ChangeLog-old$
index 14fc593c8d5c754cc5530574f99d2d33c4697e5e..32cd96a0f82b9453efedd475027855be2dd50240 100644 (file)
@@ -23,6 +23,7 @@ EXTRA_DIST = \
   .x-sc_m4_quote_check \
   .x-sc_prohibit_asprintf \
   .x-sc_prohibit_gethostby \
+  .x-sc_prohibit_gethostname \
   .x-sc_prohibit_have_config_h \
   .x-sc_prohibit_HAVE_MBRTOWC \
   .x-sc_prohibit_nonreentrant \
diff --git a/cfg.mk b/cfg.mk
index c1d3864fba08496e895c5dc86becde92cce7d8d4..45d6531c94e5916b17ba43eb6b5bb7a7b1eb0669 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -94,6 +94,11 @@ sc_prohibit_strncpy:
        msg='use virStrncpy, not strncpy'                               \
          $(_prohibit_regexp)
 
+sc_prohibit_gethostname:
+       @re='gethostname *\('                                           \
+       msg='use virGetHostname, not gethostname'                       \
+         $(_prohibit_regexp)
+
 sc_prohibit_VIR_ERR_NO_MEMORY:
        @re='\<V''IR_ERR_NO_MEMORY\>'                                   \
        msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY              \
index 9e8790023af4d35aea18abb54299897393d08ad0..5fe1506b9354d1c01a48f75397660629d7e3871e 100644 (file)
@@ -1441,7 +1441,7 @@ error:
  * @conn: pointer to a hypervisor connection
  *
  * This returns the system hostname on which the hypervisor is
- * running (the result of the gethostname(2) system call).  If
+ * running (the result of the gethostname system call).  If
  * we are connected to a remote system, then this returns the
  * hostname of the remote system.
  *