John E. Malmberg
2002-Jan-07 13:36 UTC
rsync-2.5.1 / tls.c, backup.c, syscall.c not honoring config.h SUPPORT_LINKS setting
If SUPPORT_LINKS is not 1, the code should not be assuming the presence of do_lstat or readlink. Also syscall.c is testing macro definitions that may not be defined. Operating System: OpenVMS ALPHA V7.3 Compiler: Compaq C T6.5 Compiler switches: /WARN=ENABLE=(LEVEL4, QUESTCODE) -John wb8tyw@qsl.network Personal Opinion Only EAGLE> type backup.gdiff --- ref_src:backup.c Sat Jan 5 13:27:01 2002 +++ lcl_src:backup.c Sun Jan 6 08:39:05 2002 @@ -1,3 +1,4 @@ +/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:backup.tpu on 6-JAN-2002 08:39:05.23 OPENVMS_AXP */ /* Copyright (C) Andrew Tridgell 1999 @@ -19,6 +20,9 @@ /* backup handling code */ #include "rsync.h" +#if SUPPORT_LINKS < 1 +#define do_lstat do_stat +#endif extern int verbose; extern char *backup_suffix; EAGLE> type syscall.gdiff --- ref_src:syscall.c Sat Jan 5 13:27:07 2002 +++ lcl_src:syscall.c Sun Jan 6 08:40:58 2002 @@ -1,3 +1,4 @@ +/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:syscall.tpu on 6-JAN-2002 08:40:58.14 OPENVMS_AXP */ /* Copyright (C) Andrew Tridgell 1998 @@ -35,14 +36,16 @@ return unlink(fname); } +#if SUPPORT_LINKS int do_symlink(char *fname1, char *fname2) { if (dry_run) return 0; CHECK_RO return symlink(fname1, fname2); } +#endif -#if HAVE_LINK +#if SUPPORT_HARD_LINKS int do_link(char *fname1, char *fname2) { if (dry_run) return 0; @@ -58,7 +61,7 @@ return lchown(path, owner, group); } -#if HAVE_MKNOD +#ifdef HAVE_MKNOD int do_mknod(char *pathname, mode_t mode, dev_t dev) { if (dry_run) return 0; @@ -90,7 +93,7 @@ return open(pathname, flags, mode); } -#if HAVE_CHMOD +#ifdef HAVE_CHMOD int do_chmod(const char *path, mode_t mode) { if (dry_run) return 0; @@ -138,7 +141,7 @@ int do_stat(const char *fname, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return stat64(fname, st); #else return stat(fname, st); @@ -148,7 +151,7 @@ #if SUPPORT_LINKS int do_lstat(const char *fname, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return lstat64(fname, st); #else return lstat(fname, st); @@ -158,7 +161,7 @@ int do_fstat(int fd, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return fstat64(fd, st); #else return fstat(fd, st); @@ -167,7 +170,7 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T off64_t lseek64(); return lseek64(fd, offset, whence); #else @@ -178,7 +181,7 @@ #ifdef USE_MMAP void *do_mmap(void *start, int len, int prot, int flags, int fd, OFF_T offset) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return mmap64(start, len, prot, flags, fd, offset); #else return mmap(start, len, prot, flags, fd, offset); @@ -188,7 +191,7 @@ char *d_name(struct dirent *di) { -#if HAVE_BROKEN_READDIR +#ifdef HAVE_BROKEN_READDIR return (di->d_name - 2); #else return di->d_name; EAGLE> type tls.gdiff --- ref_src:tls.c Sat Jan 5 13:27:07 2002 +++ lcl_src:tls.c Sun Jan 6 15:27:51 2002 @@ -1,3 +1,4 @@ +/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:tls.tpu on 6-JAN-2002 15:27:51.55 OPENVMS_AXP */ /* -*- c-file-style: "linux" -*- * * Copyright (C) 2001 by Martin Pool <mbp@samba.org> @@ -68,7 +69,11 @@ char datebuf[50]; char linkbuf[4096]; +#if SUPPORT_LINKS if (do_lstat(fname, &buf) == -1) +#else + if (do_stat(fname, &buf) == -1) +#endif failed ("stat", fname); /* The size of anything but a regular file is probably not @@ -86,7 +91,11 @@ buf.st_uid = buf.st_gid = 0; strcpy(linkbuf, " -> "); /* const-cast required for silly UNICOS headers */ +#if SUPPORT_LINKS len = readlink((char *) fname, linkbuf+4, sizeof(linkbuf) - 4); +#else + len = -1; +#endif if (len == -1) failed("readlink", fname); else