rsync-2.5.1 / macro definition patches

John E. Malmberg wb8tyw at qsl.net
Mon Jan 7 15:21:38 EST 2002


The following files need patches in order to compile using Compaq C
on OpenVMS.  These patches should also be needed on a Tru64 or LINUX on
ALPHA using Compaq C.  These should work on any ANSI compliant compiler.


Operating System: OpenVMS ALPHA V7.3
Compiler: Compaq C T6.5

Compiler switches: /WARN=ENABLE=(LEVEL4, QUESTCODE)


The values of macro definitions are being tested when it is possible
that they have not been defined.

Testing for a non-zero macro value is different than a macro being 
undefined.  It is possible for a macro to be defined with a value of 0.

log.c is not honoring the settings of config.h.


-John
wb8tyw at qsl.network
Personal Opinion Only

EAGLE> type log.gdiff
--- ref_src:log.c       Sat Jan  5 13:27:04 2002
+++ lcl_src:log.c       Sun Jan  6 08:40:11 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:log.tpu on 
6-JAN-2002
08:40:11.74 OPENVMS_AXP */
  /* -*- c-file-style: "linux"; -*-

     Copyright (C) 1998-2001 by Andrew Tridgell <tridge at samba.org>
@@ -26,6 +27,20 @@
    <mbp at samba.org>, Oct 2000.
    */
  #include "rsync.h"
+#ifndef LOG_SYSLOG
+#ifndef LOG_PID
+#define LOG_PID 1
+#endif
+#ifndef LOG_INFO
+#define LOG_INFO 2
+#endif
+#ifndef LOG_ERROR
+#define LOG_ERROR 3
+#endif
+#ifndef LOG_WARNING
+#define LOG_WARNING 4
+#endif
+#endif
  static char *logfname;
  static FILE *logfile;
@@ -137,8 +152,10 @@
                 fprintf(logfile,"%s [%d] %s",
                         timestring(time(NULL)), (int)getpid(), buf);
                 fflush(logfile);
+#ifdef LOG_SYSLOG
         } else {
                 syslog(priority, "%s", buf);
+#endif
         }
  }

@@ -171,18 +188,20 @@
         options |= LOG_NDELAY;
  #endif

+#ifdef LOG_SYSLOG
  #ifdef LOG_DAEMON
         openlog("rsyncd", options, lp_syslog_facility());
  #else
         openlog("rsyncd", options);
  #endif
+#endif

  #ifndef LOG_NDELAY
         logit(LOG_INFO,"rsyncd started\n");
  #endif
  }

-void log_open()
+void log_open(void)
  {
         if (logfname && !logfile) {
                 extern int orig_umask;
@@ -192,7 +211,7 @@
         }
  }

-void log_close()
+void log_close(void)
  {
         if (logfile) {
                 fclose(logfile);




EAGLE> type main.gdiff
--- ref_src:main.c      Sat Jan  5 13:27:04 2002
+++ lcl_src:main.c      Sun Jan  6 08:40:18 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:main.tpu on 
6-JAN-2002 08:40:18.58 OPENVMS_AXP */
  /* -*- c-file-style: "linux" -*-

     Copyright (C) 1996-2001 by Andrew Tridgell <tridge at samba.org>
@@ -151,7 +152,7 @@
                         args[argc++] = tok;
                 }

-#if HAVE_REMSH
+#ifdef HAVE_REMSH
                 /* remsh (on HPUX) takes the arguments the other way 
around */
                 args[argc++] = machine;
                 if (user) {



EAGLE> type options.gdiff
--- ref_src:options.c   Sat Jan  5 13:27:05 2002
+++ lcl_src:options.c   Sun Jan  6 08:40:32 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:options.tpu on 
  6-JAN-2002 08:40:32.56 OPENVMS_AXP */
  /*  -*- c-file-style: "linux" -*-

      Copyright (C) 1998-2001 by Andrew Tridgell <tridge at samba.org>
@@ -135,7 +136,7 @@
          links = "";
  #endif

-#if INET6
+#ifdef INET6
         ipv6 = "";
  #endif



EAGLE> type util.gdiff
--- ref_src:util.c      Sat Jan  5 13:27:08 2002
+++ lcl_src:util.c      Sun Jan  6 08:41:17 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:util.tpu on 
6-JAN-2002 08:41:17.72 OPENVMS_AXP */
  /*  -*- c-file-style: "linux" -*-

      Copyright (C) 1996-2000 by Andrew Tridgell
@@ -69,7 +70,7 @@
  {
         int ret;

-#if HAVE_SOCKETPAIR
+#ifdef HAVE_SOCKETPAIR
         ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
  #else
         ret = pipe(fd);
EAGLE>





More information about the rsync mailing list