On Thu, 13 Dec 2007, David Lee wrote:

> Just a quick, mostly good status report.  The 'dev' tree, as of this
> morning (Thurs 13th Dec) GMT, almost builds and does a basic tun on
> Solaris-10.
>
> The one problem, serious but fixable, is in the relatively new code
> "lib/clplumbing/cl_reboot.c" which fails to compile at all on OSes whose
> "reboot" system call takes two arguments.  (When I fudged that, it then
> built and ran a basic heartbeat.)
>
> See bugzilla 1762.

Follow-up.  I've produced a clean patch:

1. 'configure.in' does some 'AC_TRY_COMPILE()'s to determine number of
arguments, then does an 'AC_DEFINE' of a C pre-processor symbol to that
number.

2. 'lib/clplumbing/cl_reboot.c' uses that number in an '#if' sequence.


This is all on a fresh 'hg pull -u', checked with 'hg outgoing -p' etc.


BUT...

...when I try 'hg push' I get:

   searching for changes
   remote: Not trusting file dev/.hg/hgrc from untrusted user cvs, group hacvs
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: abort: Permission denied: dev/.hg/data/lib/clplumbing/cl_reboot.c.i
   remote: transaction abort!
   remote: rollback completed


What's going on.  (It's even from two different Hg installations, one on
Linux the other on Solaris.)  Why I can't I push the patch?

This patch is important for non-Linux.  Because I'm going to be mostly out
of contact, I attach the patch here; so if we can't resolve my 'hg push'
issue, could someone apply the patch, please?

Best wishes, and happy Christmas.

-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:  UNIX Team Leader                         Durham University     :
:                                           South Road            :
:  http://www.dur.ac.uk/t.d.lee/            Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :
remote: Not trusting file dev/.hg/hgrc from untrusted user cvs, group hacvs
searching for changes
changeset:   11697:70f88fcdae34
tag:         tip
user:        David Lee <[EMAIL PROTECTED]>
date:        Fri Dec 14 16:06:40 2007 +0000
summary:     configure: bug 1762: improve 'reboot()' configuration.

diff -r c6b788117bc9 -r 70f88fcdae34 configure.in
--- a/configure.in      Thu Dec 13 23:13:26 2007 -0700
+++ b/configure.in      Fri Dec 14 16:06:40 2007 +0000
@@ -1658,6 +1658,29 @@ ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes,ac_c
 
ac_cv_HAVE_SYSLOG_FACILITYNAMES=yes,ac_cv_HAVE_SYSLOG_FACILITYNAMES=no,ac_cv_HAVE_SYSLOG_FACILITYNAMES=cross)])
 if test x"$ac_cv_HAVE_SYSLOG_FACILITYNAMES" = x"yes"; then
     AC_DEFINE(HAVE_SYSLOG_FACILITYNAMES,1,[ ])
+fi
+
+dnl 'reboot()' system call: one argument (e.g. Linux) or two (e.g. Solaris)?
+dnl
+AC_CACHE_CHECK([number of arguments in reboot system call],
+  ac_cv_REBOOT_ARGS,[
+    AC_TRY_COMPILE(
+      [#include <sys/reboot.h>],
+      [(void)reboot(0);],
+      ac_cv_REBOOT_ARGS=1,
+      [AC_TRY_COMPILE(
+        [#include <sys/reboot.h>],
+        [(void)reboot(0,NULL);],
+        ac_cv_REBOOT_ARGS=2,
+        ac_cv_REBOOT_ARGS=0
+      )],
+      ac_cv_REBOOT_ARGS=0
+    )
+  ]
+)
+dnl Argument count of 0 suggests no known 'reboot()' call.
+if test "$ac_cv_REBOOT_ARGS" -ge "1"; then
+  AC_DEFINE_UNQUOTED(REBOOT_ARGS,$ac_cv_REBOOT_ARGS,[number of arguments for 
reboot system call])
 fi
 
 dnl
diff -r c6b788117bc9 -r 70f88fcdae34 lib/clplumbing/cl_reboot.c
--- a/lib/clplumbing/cl_reboot.c        Thu Dec 13 23:13:26 2007 -0700
+++ b/lib/clplumbing/cl_reboot.c        Fri Dec 14 16:06:40 2007 +0000
@@ -11,8 +11,6 @@
 #endif
 #include <clplumbing/cl_log.h>
 #include <clplumbing/timers.h>
-
-#define        REBOOT1ARG      1
 
 enum rebootopt {
        REBOOT_DEFAULT = 0,
@@ -46,9 +44,9 @@ void cl_reboot(int msdelaybeforereboot, 
        cl_log(LOG_EMERG, "Rebooting system.  Reason: %s", reason);
        sync();
        mssleep(msdelaybeforereboot);
-#ifdef REBOOT1ARG
+#if REBOOT_ARGS == 1
        reboot(rebootflag);
-#elif REBOOT2ARG
+#elif REBOOT_ARGS == 2
        reboot(rebootflag, NULL);
 #else
 #error "reboot() call needs to take one or two args"

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to