View | Details | Raw Unified | Return to bug 229115 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/bbcp/Makefile (-3 / +16 lines)
Lines 12-23 Link Here
12
LICENSE=	LGPL20
12
LICENSE=	LGPL20
13
LICENSE_FILE=	${WRKSRC}/src/COPYING.LESSER
13
LICENSE_FILE=	${WRKSRC}/src/COPYING.LESSER
14
14
15
BROKEN=		fails to build
16
17
USES=		tar:xz
15
USES=		tar:xz
16
USE_CXXSTD=	c++98
18
17
19
PLIST_FILES=	bin/bbcp
18
PLIST_FILES=	bin/bbcp
20
PORTDOCS=	${PORTNAME}.pdf
19
PORTDOCS=	FREEBSDUSERS ${PORTNAME}.pdf
21
20
22
BUILD_WRKSRC=	${WRKSRC}/src
21
BUILD_WRKSRC=	${WRKSRC}/src
23
22
Lines 30-36 Link Here
30
do-install:
29
do-install:
31
	${INSTALL_PROGRAM} ${WRKSRC}/bin/FreeBSD/bbcp ${STAGEDIR}${PREFIX}/bin
30
	${INSTALL_PROGRAM} ${WRKSRC}/bin/FreeBSD/bbcp ${STAGEDIR}${PREFIX}/bin
32
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
31
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
32
	${INSTALL_DATA} ${FILESDIR}/FREEBSDUSERS \
33
		${STAGEDIR}${DOCSDIR}/FREEBSDUSERS
33
	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.pdf \
34
	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.pdf \
34
		${STAGEDIR}${DOCSDIR}/${PORTNAME}.pdf
35
		${STAGEDIR}${DOCSDIR}/${PORTNAME}.pdf
35
36
37
post-install:
38
	@${ECHO_MSG} "********************************************************"
39
	@${ECHO_MSG} "*           IMPORTANT           IMPORTANT              *"
40
	@${ECHO_MSG} "********************************************************"
41
	@${ECHO_MSG} "*  Please read ${DOCSDIR}/FREEBSDUSERS"
42
	@${ECHO_MSG} "*  for valuable information regarding some of the"
43
	@${ECHO_MSG} "*  problems users have reported running ${PORTNAME} on"
44
	@${ECHO_MSG} "*  FreeBSD, and the solutions to many, if not all"
45
	@${ECHO_MSG} "*  of them."
46
	@${ECHO_MSG} "*"
47
	@${ECHO_MSG} "********************************************************"
48
36
.include <bsd.port.mk>
49
.include <bsd.port.mk>
(-)sysutils/bbcp/files/FREEBSDUSERS (+58 lines)
Line 0 Link Here
1
First off a HUGE thanks go out to fjwcash@
2
for his relentless, and tireless work with this. I can't thank you enough!
3
4
That said, and for all others whom claim it doesn't work;
5
The answer(s) are as follows:
6
7
The following makes things work:
8
9
On the receiving server:
10
    sysctl net.inet6.ip6.v6only=0
11
    install bbcp-20150116.txz
12
13
On the sending server:
14
    sysctl net.inet6.ip6.v6only=0
15
    install bbcp-20150116.txz
16
    add "-4 c" to the start of the bbcp command
17
18
With the above, I am able to use the latest version of the bbcp package
19
to send data between servers.
20
21
Command-line used:
22
23
bbcp -4 c -N io "zfs send -I ${localpool}/${localfs}/${site}@${lastsnap} \
24
     ${localpool}/${localfs}/${site}@${yesterday}" \
25
     ${user}@${remotehost}:"${zfs} recv ${recvopts} ${rempool}"
26
27
28
Taken from the bbcp website (when in doubt, google it out):
29
30
--ipv4 [who] | -4 [who]
31
uses the IPv4 TCP stack for command processing and source-target connections.
32
This option is incompatible with IPv6 addresses. The optional who argument
33
restricts IPv4 mode to the command if c is specified, the source if s is
34
specified or the target if t is specified. The default is cst (i.e. everywhere).
35
If who is omitted and --ipv4 is the last option on the command line it must
36
be followed by the -- option (double dash). 
37
38
So, it looks like the "-h" output should be updated to use:
39
40
[-4 [cst]]
41
42
Or similar, with an explanation of what c, s, and t stand for?
43
44
  -c ( Compression )
45
46
  -s ( Streams )
47
48
  -t ( tlim - (timelimit) )
49
50
On another note, "-4 s" and "-4 t" end with segmentation faults. 
51
The only option that works is "-4 c".
52
53
So, until, or unless I'm able to overcome the problems with the -s, and
54
-t switches; don't use them.
55
56
Thanks again, fjwcash@ !
57
58
--Chris
(-)sysutils/bbcp/files/patch-src__bbcp_Args.C (-20 lines)
Lines 1-20 Link Here
1
--- src/bbcp_Args.C.orig	2015-01-16 13:16:09.000000000 -0800
2
+++ src/bbcp_Args.C	2015-01-16 13:17:22.000000000 -0800
3
@@ -58,7 +58,7 @@
4
          bbcp_Opt *p = this;
5
          do if (i <= p->Optmaxl && i >= p->Optminl &&
6
                !strncmp(p->Optword, optarg, i)) return p->Optvalu;
7
-            while(p = p->Optnext);
8
+            while((p = p->Optnext));
9
          return 0;
10
         }
11
 
12
@@ -203,7 +203,7 @@
13
    if (optspec[1] == '.')
14
       {if (argval && *argval == '-')
15
           if (inStream) arg_stream.RetToken();
16
-             else Aloc--;
17
+             }else{ Aloc--;
18
        argval = 0;
19
        return *optspec;
20
       }
(-)sysutils/bbcp/files/patch-src__bbcp_BuffPool.C (-28 lines)
Lines 1-28 Link Here
1
--- src/bbcp_BuffPool.C.orig	2015-01-16 13:30:31.000000000 -0800
2
+++ src/bbcp_BuffPool.C	2015-01-16 13:33:14.000000000 -0800
3
@@ -32,7 +32,7 @@
4
 #include <inttypes.h>
5
 #include <sys/mman.h>
6
 
7
-#if defined(MACOS) || defined(AIX)
8
+#if defined(MACOS) || defined(AIX) || defined(FREEBSD)
9
 #define memalign(pgsz,amt) valloc(amt)
10
 #else
11
 #include <malloc.h>
12
@@ -84,14 +84,14 @@
13
 
14
 // Free all of the buffers in the empty queue
15
 //
16
-   while(currp = last_empty)
17
+   while((currp = last_empty))
18
         {last_empty = last_empty->next; delete currp;}
19
 //cerr <<bbcp_Debug.Who <<"Bdestroy num " <<j++ <<" @ " <<hex <<(int)currp <<dec <<endl;
20
 
21
 // Free all full buffers
22
 //
23
    FullPool.Lock();
24
-   while(currp = next_full)
25
+   while((currp = next_full))
26
         {next_full = next_full->next; delete currp;}
27
    FullPool.UnLock();
28
 }
(-)sysutils/bbcp/files/patch-src__bbcp_Config.C (-39 lines)
Lines 1-39 Link Here
1
--- src/bbcp_Config.C.orig	2015-01-16 13:59:00.000000000 -0800
2
+++ src/bbcp_Config.C	2015-01-16 14:04:21.000000000 -0800
3
@@ -265,7 +265,7 @@
4
 
5
 // Process the options
6
 //
7
-   while (c=arglist.getopt())
8
+   while ((c=arglist.getopt()))
9
      { switch(c)
10
        {
11
        case 'a': Options |= bbcp_APPEND | bbcp_ORDER;
12
@@ -775,8 +775,8 @@
13
 
14
 // Use the config file, if present
15
 //
16
-   if (ConfigFN = getenv("bbcp_CONFIGFN"))
17
-      {if (retc = Configure(ConfigFN)) return retc;}
18
+   if ((ConfigFN = getenv("bbcp_CONFIGFN")))
19
+      {if ((retc = Configure(ConfigFN))) return retc;}
20
       else {
21
       // Use configuration file in the home directory, if any
22
       //
23
@@ -786,7 +786,7 @@
24
       strcpy(ConfigFN, homedir); strcat(ConfigFN, cfn);
25
       if (stat(ConfigFN, &buf))
26
          {retc = 0; free(ConfigFN); ConfigFN = 0;}
27
-         else if (retc = Configure(ConfigFN)) return retc;
28
+         else if ((retc = Configure(ConfigFN))) return retc;
29
      }
30
 
31
 // Establish the FD limit
32
@@ -1361,7 +1361,7 @@
33
     if (*hn == ':' && hn++ && *hn)
34
        {errno = 0;
35
         pnum = strtol(hn, (char **)NULL, 10);
36
-        if (!pnum && errno || pnum > 65535)
37
+        if ((!pnum && errno) || pnum > 65535)
38
            {bbcp_Fmsg("Config",what,"port invalid -", hn); return -1;}
39
        }
(-)sysutils/bbcp/files/patch-src__bbcp_File.C (-20 lines)
Lines 1-20 Link Here
1
--- src/bbcp_File.C.orig	2015-01-15 18:41:10.000000000 -0800
2
+++ src/bbcp_File.C	2015-01-15 18:43:04.000000000 -0800
3
@@ -44,7 +44,7 @@
4
 
5
 #ifdef FREEBSD
6
 #undef ENODATA
7
-#define ENODATA ENOATTRR
8
+#define ENODATA ENOATTR
9
 #endif
10
 
11
 /******************************************************************************/
12
@@ -153,7 +153,7 @@
13
 
14
 // Find a buffer
15
 //
16
-   if (bp = nextbuff)
17
+   if ((bp = nextbuff))
18
       while(bp && bp->boff != offset) {pp = bp; bp = bp->next;}
19
 
20
 // If we found a buffer, unchain it
(-)sysutils/bbcp/files/patch-src__bbcp_FileSpec.C (-38 lines)
Lines 1-38 Link Here
1
--- src/bbcp_FileSpec.C.orig	2015-01-16 14:34:11.000000000 -0800
2
+++ src/bbcp_FileSpec.C	2015-01-16 14:36:54.000000000 -0800
3
@@ -174,7 +174,7 @@
4
 
5
 // Get the current state of the file or directory
6
 //
7
-        if (retc = FSp->Stat(targpath, &Targ)) targetsz = 0;
8
+        if ((retc = FSp->Stat(targpath, &Targ))) targetsz = 0;
9
    else if (Targ.Otype == 'p' && (bbcp_Config.Options & bbcp_XPIPE))
10
                                {targetsz =  0; return 0;}
11
    else if (Targ.Otype != 'f') {targetsz = -1; return 0;}
12
@@ -211,7 +211,7 @@
13
 // in the directory. This will later be set to the true mode if it differs.
14
 //
15
    DEBUG("Make link " <<targpath <<" -> " <<Info.SLink);
16
-   if (retc = FSp->MKLnk(Info.SLink, targpath))
17
+   if ((retc = FSp->MKLnk(Info.SLink, targpath)))
18
       return bbcp_Emsg("Create_Link", retc, "creating link", targpath);
19
 
20
 // All done
21
@@ -232,7 +232,7 @@
22
 // in the directory. This will later be set to the true mode if it differs.
23
 //
24
    DEBUG("Make path " <<Info.mode <<' ' <<targpath);
25
-   if (retc = FSp->MKDir(targpath, bbcp_Config.ModeDC))
26
+   if ((retc = FSp->MKDir(targpath, bbcp_Config.ModeDC)))
27
       if (retc == -EEXIST) return 0;
28
          else return bbcp_Emsg("Create_Path", retc, "creating path", targpath);
29
 
30
@@ -764,7 +764,7 @@
31
                         else bbcp_Config.srcPath = PS_New;
32
              PS_Prv = PS_New; PS_Cur = PS_New->next;
33
             }
34
-         if (*cp = delim) cp++;
35
+         if ((*cp = delim)) cp++;
36
         }
37
 }
38
 
(-)sysutils/bbcp/files/patch-src__bbcp_NetAddr.C (-11 lines)
Lines 1-11 Link Here
1
--- src/bbcp_NetAddr.C.orig	2015-01-14 12:13:30.000000000 -0800
2
+++ src/bbcp_NetAddr.C	2015-01-14 12:25:34.000000000 -0800
3
@@ -49,7 +49,7 @@
4
 #ifndef s6_addr32
5
 #if   defined(SUN)
6
 #define s6_addr32 _S6_un._S6_u32
7
-#elif defined(MACOS)
8
+#elif defined(MACOS) || defined(FREEBSD)
9
 #define s6_addr32 __u6_addr.__u6_addr32
10
 #endif
11
 #endif
(-)sysutils/bbcp/files/patch-src__bbcp_NetAddrInfo.C (-11 lines)
Lines 1-11 Link Here
1
--- src/bbcp_NetAddrInfo.C.orig	2015-01-14 12:14:07.000000000 -0800
2
+++ src/bbcp_NetAddrInfo.C	2015-01-14 12:26:37.000000000 -0800
3
@@ -67,7 +67,7 @@
4
 #ifndef s6_addr32
5
 #if   defined(SUN)
6
 #define s6_addr32 _S6_un._S6_u32
7
-#elif defined(MACOS)
8
+#elif defined(MACOS) || defined(FREEBSD)
9
 #define s6_addr32 __u6_addr.__u6_addr32
10
 #endif
11
 #endif
(-)sysutils/bbcp/files/patch-src__bbcp_Node.C (-76 lines)
Lines 1-76 Link Here
1
--- src/bbcp_Node.C.orig	2015-01-15 22:20:08.000000000 -0800
2
+++ src/bbcp_Node.C	2015-01-15 22:31:02.000000000 -0800
3
@@ -94,7 +94,7 @@
4
      bbcp_Link     *link;
5
      int            retc;
6
 
7
-     if (link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport))
8
+     if ((link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport)))
9
         {if ((retc = protocol->Login(link, 0)) < 0)
10
             {delete link; link = 0;}
11
         }
12
@@ -354,8 +354,8 @@
13
             oflag = O_WRONLY | O_CREAT | O_TRUNC;
14
            }
15
    else if (bbcp_Config.Options & bbcp_APPEND)
16
-           {if (retc = fp->WriteSigFile()) return retc;
17
-            if (startoff = fp->targetsz) oflag = O_WRONLY;
18
+           {if ((retc = fp->WriteSigFile())) return retc;
19
+            if ((startoff = fp->targetsz)) oflag = O_WRONLY;
20
                else oflag = O_CREAT | O_WRONLY;
21
            }
22
    else    oflag = O_WRONLY | O_CREAT | O_EXCL;
23
@@ -368,7 +368,7 @@
24
 
25
 // Tell the user what we are bout to do
26
 //
27
-   if (bbcp_Config.Options & bbcp_BLAB | bbcp_Config.Progint)
28
+   if ((bbcp_Config.Options & bbcp_BLAB) | bbcp_Config.Progint)
29
       if (bbcp_Config.Options & bbcp_APPEND)
30
          {char buff[32];
31
           sprintf(buff, "%lld", startoff);
32
@@ -464,7 +464,7 @@
33
 // Wait for the expansion thread to end
34
 //
35
    if (bbcp_Config.Options & bbcp_COMPRESS)
36
-      {if (tretc = (long)bbcp_Thread_Wait(cxp->TID)) retc = 128;
37
+      {if ((tretc = (long)bbcp_Thread_Wait(cxp->TID))) retc = 128;
38
        DEBUG("File expansion ended; rc=" <<tretc);
39
       }
40
 
41
@@ -478,7 +478,7 @@
42
 // Make sure each thread has terminated normally
43
 //
44
    for (i = 0; i < dlcount; i++)
45
-       {if (tretc = (long)bbcp_Thread_Wait(link_tid[i])) retc = 128;
46
+       {if ((tretc = (long)bbcp_Thread_Wait(link_tid[i]))) retc = 128;
47
         DEBUG("Thread " <<link_tid[i] <<" stream " <<i <<" ended; rc=" <<tretc);
48
        }
49
 
50
@@ -618,7 +618,7 @@
51
 // Wait for compression thread to end
52
 //
53
    if (bbcp_Config.Options & bbcp_COMPRESS)
54
-      {if (tretc = (long)bbcp_Thread_Wait(cxp->TID)) retc = 128;
55
+      {if ((tretc = (long)bbcp_Thread_Wait(cxp->TID))) retc = 128;
56
        DEBUG("File compression ended; rc=" <<tretc);
57
        delete cxp;
58
       }
59
@@ -626,7 +626,7 @@
60
 // Make sure each link thread has terminated normally.
61
 //
62
    for (i = 0; i < iocount; i++)
63
-       {if (tretc = (long)bbcp_Thread_Wait(link_tid[i])) retc = 128;
64
+       {if ((tretc = (long)bbcp_Thread_Wait(link_tid[i]))) retc = 128;
65
         DEBUG("Thread " <<link_tid[i] <<" stream " <<i <<" ended; rc=" <<tretc);
66
        }
67
 
68
@@ -735,7 +735,7 @@
69
 
70
 // Establish the control connection first
71
 //
72
-   if (link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport, 3))
73
+   if ((link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport, 3)))
74
       if ((retc = protocol->Login(link, 0)) < 0)
75
          {delete link; link = 0;}
76
 
(-)sysutils/bbcp/files/patch-src__bbcp_ProcMon.C (-20 lines)
Lines 1-20 Link Here
1
--- src/bbcp_ProcMon.C.orig	2015-01-15 22:40:09.000000000 -0800
2
+++ src/bbcp_ProcMon.C	2015-01-15 22:41:33.000000000 -0800
3
@@ -132,7 +132,7 @@
4
 
5
 // Run a thread to start the monitor
6
 //
7
-   if (retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid))
8
+   if ((retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid)))
9
       {DEBUG("Error " <<retc <<" starting MonProc thread.");}
10
       else {DEBUG("Thread " <<mytid <<" monitoring process " <<monPID);}
11
    return;
12
@@ -154,7 +154,7 @@
13
 
14
 // Run a thread to start the monitor
15
 //
16
-   if (retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid))
17
+   if ((retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid)))
18
       {DEBUG("Error " <<retc <<" starting buffpool monitor thread.");}
19
       else {DEBUG("Thread " <<mytid <<" monitoring buffpool.");}
20
    return;
(-)sysutils/bbcp/files/patch-src__bbcp_ProgMon.C (-11 lines)
Lines 1-11 Link Here
1
--- src/bbcp_ProgMon.C.orig	2015-01-15 22:47:57.000000000 -0800
2
+++ src/bbcp_ProgMon.C	2015-01-15 22:49:27.000000000 -0800
3
@@ -146,7 +146,7 @@
4
 
5
 // Run a thread to start the monitor
6
 //
7
-   if (retc = bbcp_Thread_Run(bbcp_MonProg, (void *)this, &mytid))
8
+   if ((retc = bbcp_Thread_Run(bbcp_MonProg, (void *)this, &mytid)))
9
       {DEBUG("Error " <<retc <<" starting progress monitor thread.");}
10
       else {DEBUG("Thread " <<mytid <<" monitoring progress.");}
11
    return;
(-)sysutils/bbcp/files/patch-src__bbcp_Protocol.C (-77 lines)
Lines 1-77 Link Here
1
--- src/bbcp_Protocol.C.orig	2015-01-16 11:37:43.000000000 -0800
2
+++ src/bbcp_Protocol.C	2015-01-16 11:41:33.000000000 -0800
3
@@ -86,7 +86,7 @@
4
 
5
 // Start-up the first node
6
 //
7
-   if (retc = Fnode->Run(Ffs->username, Ffs->hostname, Fcmd, Ftype))
8
+   if ((retc = Fnode->Run(Ffs->username, Ffs->hostname, Fcmd, Ftype)))
9
       return retc;
10
 
11
 // Determine additional options
12
@@ -101,15 +101,15 @@
13
 
14
 // Send the arguments
15
 //
16
-   if (retc = SendArgs(Fnode, Ffs, (char *)"none", 0, addOpt[0])) return retc;
17
+   if ((retc = SendArgs(Fnode, Ffs, (char *)"none", 0, addOpt[0]))) return retc;
18
 
19
 // Get the callback port from the first host
20
 //
21
-   if (retc = getCBPort(Fnode)) return retc;
22
+   if ((retc = getCBPort(Fnode))) return retc;
23
 
24
 // Start the second node
25
 //
26
-   if (retc = Lnode->Run(Lfs->username, Lfs->hostname, Lcmd, Ltype))
27
+   if ((retc = Lnode->Run(Lfs->username, Lfs->hostname, Lcmd, Ltype)))
28
       return retc;
29
 
30
 // Compute callback hostname and reset callback port
31
@@ -152,7 +152,7 @@
32
 
33
 // The remote program should hve started, get the call back port
34
 //
35
-   if (wp = Node->GetLine())
36
+   if ((wp = Node->GetLine()))
37
       {if ((wp = Node->GetToken()) && !strcmp(wp, "200")
38
        &&  (wp = Node->GetToken()) && !strcmp(wp, "Port:")
39
        &&  (wp = Node->GetToken())
40
@@ -408,7 +408,7 @@
41
 
42
 // Get the optional offset
43
 //
44
-   if (wp = Remote->GetToken())
45
+   if ((wp = Remote->GetToken()))
46
       {if (bbcp_Config.a2ll("file offset", wp, foffset, 0, -1)) return 22;
47
        if (foffset > fp->Info.size)
48
           {char buff[128];
49
@@ -447,7 +447,7 @@
50
 // Get the first line of the login stream
51
 //
52
    if (!(np->GetLine()))
53
-      {if (retc = np->LastError())
54
+      {if ((retc = np->LastError()))
55
           return bbcp_Emsg("Process_Login", retc, "processing login from",
56
                                  Net->LinkName());
57
        return bbcp_Fmsg("Process_Login", "Bad login from", Net->LinkName());
58
@@ -549,8 +549,8 @@
59
    if (texists && bbcp_Config.snkSpec->Info.Otype == 'd')
60
        tdir = bbcp_Config.snkSpec->pathname;
61
       else {int plen;
62
-            if (plen = bbcp_Config.snkSpec->filename -
63
-                       bbcp_Config.snkSpec->pathname)
64
+            if ((plen = bbcp_Config.snkSpec->filename -
65
+                       bbcp_Config.snkSpec->pathname))
66
                strncpy(buff, bbcp_Config.snkSpec->pathname, plen-1);
67
                else {buff[0] = '.'; plen = 2;}
68
             tdir = buff; buff[plen-1] = '\0';
69
@@ -562,7 +562,7 @@
70
       tdir_id = bbcp_Config.snkSpec->Info.fileid;
71
       else {bbcp_FileInfo Tinfo;
72
             if (!fs_obj || (!(retc = fs_obj->Stat(tdir, &Tinfo))
73
-            && Tinfo.Otype != 'd') && outDir) retc = ENOTDIR;
74
+            && (Tinfo.Otype != 'd') && outDir)) retc = ENOTDIR;
75
             if (retc) {bbcp_Fmsg("Request","Target directory",
76
                                  bbcp_Config.snkSpec->pathname,"not found");
77
                        return Request_exit(2, dRM);
(-)sysutils/bbcp/files/patch-src__bbcp_Pthread.C (-20 lines)
Lines 1-20 Link Here
1
--- src/bbcp_Pthread.C.orig	2015-01-16 13:38:06.000000000 -0800
2
+++ src/bbcp_Pthread.C	2015-01-16 13:39:48.000000000 -0800
3
@@ -128,7 +128,7 @@
4
 /*                              C o n d W a i t                               */
5
 /******************************************************************************/
6
 
7
-#if defined(MACOS) || defined(AIX)
8
+#if defined(MACOS) || defined(AIX) || defined(FREEBSD)
9
 
10
 int bbcp_Semaphore::CondWait()
11
 {
12
@@ -215,7 +215,7 @@
13
 void *bbcp_Thread_Wait(pthread_t tid)
14
     {long retc;
15
      void *tstat;
16
-     if (retc = pthread_join(tid, (void **)&tstat)) tstat = (void *)retc;
17
+     if ((retc = pthread_join(tid, (void **)&tstat))) tstat = (void *)retc;
18
      return tstat;
19
     }
20
 
(-)sysutils/bbcp/files/patch-src__bbcp_Pthread.h (-11 lines)
Lines 1-11 Link Here
1
--- src/bbcp_Pthread.h.orig	2015-01-16 13:41:31.000000000 -0800
2
+++ src/bbcp_Pthread.h	2015-01-16 13:42:14.000000000 -0800
3
@@ -108,7 +108,7 @@
4
 bbcp_Mutex *monMutex;
5
 };
6
 
7
-#if defined(MACOS) || defined(AIX)
8
+#if defined(MACOS) || defined(AIX) || defined(FREEBSD)
9
 class bbcp_Semaphore
10
 {
11
 public:
(-)sysutils/bbcp/files/patch-src__bbcp_Stream.C (-20 lines)
Lines 1-20 Link Here
1
--- src/bbcp_Stream.C.orig	2015-01-16 11:52:58.000000000 -0800
2
+++ src/bbcp_Stream.C	2015-01-16 11:55:23.000000000 -0800
3
@@ -206,7 +206,7 @@
4
            return bbcp_Emsg("Exec",errno,"creating a pipe for",parm[0]);
5
         Child_In=fildes_In[0]; Child_Out=fildes_Out[1]; Child_Err=fildes_Err[1];
6
         fildes_Out[1] = (inrd ? fildes_In[1] : -1);
7
-        if (retc = Attach(fildes_Out)) return retc;
8
+        if ((retc = Attach(fildes_Out))) return retc;
9
        }
10
 
11
     // Fork a process first so we can pick up the next request.
12
@@ -436,7 +436,7 @@
13
      // If we have a token, return it
14
      //
15
      xline = 1;
16
-     if (wp = GetToken(lowcase)) return wp;
17
+     if ((wp = GetToken(lowcase))) return wp;
18
 
19
      // If no continuation allowed, return a null (but only once)
20
      //
(-)sysutils/bbcp/files/patch-src__bbcp_System.C (-47 lines)
Lines 1-47 Link Here
1
--- src/bbcp_System.C.orig	2015-01-16 11:58:47.000000000 -0800
2
+++ src/bbcp_System.C	2015-01-16 12:01:30.000000000 -0800
3
@@ -108,7 +108,7 @@
4
 // Convert the group name to a gid
5
 //
6
    Glookup.Lock();
7
-   if (gp = getgrnam(group)) gid = gp->gr_gid;
8
+   if ((gp = getgrnam(group))) gid = gp->gr_gid;
9
       else gid = (gid_t)-1;
10
    Glookup.UnLock();
11
    return gid;
12
@@ -126,7 +126,7 @@
13
 // Get the group name
14
 //
15
    Glookup.Lock();
16
-   if (gp = getgrgid(gid)) gnmp = gp->gr_name;
17
+   if ((gp = getgrgid(gid))) gnmp = gp->gr_name;
18
       else gnmp = (char *)"nogroup";
19
    Glookup.UnLock();
20
 
21
@@ -151,7 +151,7 @@
22
 
23
 // Get the password entry for this uid
24
 //
25
-   if (pwp = getpwuid(myuid)) homedir = pwp->pw_dir;
26
+   if ((pwp = getpwuid(myuid))) homedir = pwp->pw_dir;
27
       else homedir = (char *)"/tmp";
28
 
29
 // Return a copy of the directory
30
@@ -170,7 +170,7 @@
31
     int rc, grandpa;
32
 
33
     sprintf(cmd, PS_CMD, getppid());
34
-    if (rc = cmdstream.Exec(cmd)) rc = cmdstream.LastError();
35
+    if ((rc = cmdstream.Exec(cmd))) rc = cmdstream.LastError();
36
        else if (!cmdstream.GetLine() || !(lp = cmdstream.GetLine())) rc = -33;
37
                else {errno = 0;
38
                      grandpa = strtol(lp, (char **)NULL, 10);
39
@@ -218,7 +218,7 @@
40
 
41
 // Get the password entry for this uid
42
 //
43
-   if (pwp = getpwuid(myuid)) uname = pwp->pw_name;
44
+   if ((pwp = getpwuid(myuid))) uname = pwp->pw_name;
45
       else uname = (char *)"anonymous";
46
 
47
 // Return a copy of the directory
(-)sysutils/bbcp/files/patch-src__bbcp_ZCX.C (-11 lines)
Lines 1-11 Link Here
1
--- src/bbcp_ZCX.C.orig	2015-01-16 12:06:04.000000000 -0800
2
+++ src/bbcp_ZCX.C	2015-01-16 12:06:59.000000000 -0800
3
@@ -144,7 +144,7 @@
4
 
5
 // If we have gotten here then all went well so far flush output
6
 //
7
-   if (obp->blen = outsz - ZStream.avail_out)
8
+   if ((obp->blen = outsz - ZStream.avail_out))
9
       {obp->boff = outbytes; outbytes += obp->blen;
10
        Obuff->putFullBuff(obp);
11
        if (!(obp = Obuff->getEmptyBuff())) return ENOBUFS;
(-)sysutils/bbcp/files/patch-src_bbcp__Args.C (+20 lines)
Line 0 Link Here
1
--- src/bbcp_Args.C.orig	2015-01-14 19:57:32 UTC
2
+++ src/bbcp_Args.C
3
@@ -58,7 +58,7 @@ char *operator%(char *optarg)
4
          bbcp_Opt *p = this;
5
          do if (i <= p->Optmaxl && i >= p->Optminl &&
6
                !strncmp(p->Optword, optarg, i)) return p->Optvalu;
7
-            while(p = p->Optnext);
8
+            while((p = p->Optnext));
9
          return 0;
10
         }
11
 
12
@@ -203,7 +203,7 @@ char bbcp_Args::getopt()
13
    if (optspec[1] == '.')
14
       {if (argval && *argval == '-')
15
           if (inStream) arg_stream.RetToken();
16
-             else Aloc--;
17
+             }else{ Aloc--;
18
        argval = 0;
19
        return *optspec;
20
       }
(-)sysutils/bbcp/files/patch-src_bbcp__BuffPool.C (+28 lines)
Line 0 Link Here
1
--- src/bbcp_BuffPool.C.orig	2015-01-14 20:12:20 UTC
2
+++ src/bbcp_BuffPool.C
3
@@ -32,7 +32,7 @@
4
 #include <inttypes.h>
5
 #include <sys/mman.h>
6
 
7
-#if defined(MACOS) || defined(AIX)
8
+#if defined(MACOS) || defined(AIX) || defined(FREEBSD)
9
 #define memalign(pgsz,amt) valloc(amt)
10
 #else
11
 #include <malloc.h>
12
@@ -84,14 +84,14 @@ bbcp_BuffPool::~bbcp_BuffPool()
13
 
14
 // Free all of the buffers in the empty queue
15
 //
16
-   while(currp = last_empty)
17
+   while((currp = last_empty))
18
         {last_empty = last_empty->next; delete currp;}
19
 //cerr <<bbcp_Debug.Who <<"Bdestroy num " <<j++ <<" @ " <<hex <<(int)currp <<dec <<endl;
20
 
21
 // Free all full buffers
22
 //
23
    FullPool.Lock();
24
-   while(currp = next_full)
25
+   while((currp = next_full))
26
         {next_full = next_full->next; delete currp;}
27
    FullPool.UnLock();
28
 }
(-)sysutils/bbcp/files/patch-src_bbcp__Config.C (+40 lines)
Line 0 Link Here
1
--- src/bbcp_Config.C.orig	2015-01-14 19:58:17 UTC
2
+++ src/bbcp_Config.C
3
@@ -265,7 +265,7 @@ void bbcp_Config::Arguments(int argc, char **argv, int
4
 
5
 // Process the options
6
 //
7
-   while (c=arglist.getopt())
8
+   while ((c=arglist.getopt()))
9
      { switch(c)
10
        {
11
        case 'a': Options |= bbcp_APPEND | bbcp_ORDER;
12
@@ -775,8 +775,8 @@ int bbcp_Config::ConfigInit(int argc, char **argv)
13
 
14
 // Use the config file, if present
15
 //
16
-   if (ConfigFN = getenv("bbcp_CONFIGFN"))
17
-      {if (retc = Configure(ConfigFN)) return retc;}
18
+   if ((ConfigFN = getenv("bbcp_CONFIGFN")))
19
+      {if ((retc = Configure(ConfigFN))) return retc;}
20
       else {
21
       // Use configuration file in the home directory, if any
22
       //
23
@@ -786,7 +786,7 @@ int bbcp_Config::ConfigInit(int argc, char **argv)
24
       strcpy(ConfigFN, homedir); strcat(ConfigFN, cfn);
25
       if (stat(ConfigFN, &buf))
26
          {retc = 0; free(ConfigFN); ConfigFN = 0;}
27
-         else if (retc = Configure(ConfigFN)) return retc;
28
+         else if ((retc = Configure(ConfigFN))) return retc;
29
      }
30
 
31
 // Establish the FD limit
32
@@ -1361,7 +1361,7 @@ int bbcp_Config::HostAndPort(const char *what, char *p
33
     if (*hn == ':' && hn++ && *hn)
34
        {errno = 0;
35
         pnum = strtol(hn, (char **)NULL, 10);
36
-        if (!pnum && errno || pnum > 65535)
37
+        if ((!pnum && errno) || pnum > 65535)
38
            {bbcp_Fmsg("Config",what,"port invalid -", hn); return -1;}
39
        }
40
 
(-)sysutils/bbcp/files/patch-src_bbcp__File.C (+20 lines)
Line 0 Link Here
1
--- src/bbcp_File.C.orig	2015-01-14 20:12:57 UTC
2
+++ src/bbcp_File.C
3
@@ -44,7 +44,7 @@
4
 
5
 #ifdef FREEBSD
6
 #undef ENODATA
7
-#define ENODATA ENOATTRR
8
+#define ENODATA ENOATTR
9
 #endif
10
 
11
 /******************************************************************************/
12
@@ -153,7 +153,7 @@ bbcp_Buffer *bbcp_File::getBuffer(long long offset)
13
 
14
 // Find a buffer
15
 //
16
-   if (bp = nextbuff)
17
+   if ((bp = nextbuff))
18
       while(bp && bp->boff != offset) {pp = bp; bp = bp->next;}
19
 
20
 // If we found a buffer, unchain it
(-)sysutils/bbcp/files/patch-src_bbcp__FileSpec.C (+38 lines)
Line 0 Link Here
1
--- src/bbcp_FileSpec.C.orig	2015-01-14 20:00:12 UTC
2
+++ src/bbcp_FileSpec.C
3
@@ -174,7 +174,7 @@ int bbcp_FileSpec::Compose(long long did, char *dpath,
4
 
5
 // Get the current state of the file or directory
6
 //
7
-        if (retc = FSp->Stat(targpath, &Targ)) targetsz = 0;
8
+        if ((retc = FSp->Stat(targpath, &Targ))) targetsz = 0;
9
    else if (Targ.Otype == 'p' && (bbcp_Config.Options & bbcp_XPIPE))
10
                                {targetsz =  0; return 0;}
11
    else if (Targ.Otype != 'f') {targetsz = -1; return 0;}
12
@@ -211,7 +211,7 @@ int bbcp_FileSpec::Create_Link()
13
 // in the directory. This will later be set to the true mode if it differs.
14
 //
15
    DEBUG("Make link " <<targpath <<" -> " <<Info.SLink);
16
-   if (retc = FSp->MKLnk(Info.SLink, targpath))
17
+   if ((retc = FSp->MKLnk(Info.SLink, targpath)))
18
       return bbcp_Emsg("Create_Link", retc, "creating link", targpath);
19
 
20
 // All done
21
@@ -232,7 +232,7 @@ int bbcp_FileSpec::Create_Path()
22
 // in the directory. This will later be set to the true mode if it differs.
23
 //
24
    DEBUG("Make path " <<Info.mode <<' ' <<targpath);
25
-   if (retc = FSp->MKDir(targpath, bbcp_Config.ModeDC))
26
+   if ((retc = FSp->MKDir(targpath, bbcp_Config.ModeDC)))
27
       if (retc == -EEXIST) return 0;
28
          else return bbcp_Emsg("Create_Path", retc, "creating path", targpath);
29
 
30
@@ -764,7 +764,7 @@ void bbcp_FileSpec::BuildPaths()
31
                         else bbcp_Config.srcPath = PS_New;
32
              PS_Prv = PS_New; PS_Cur = PS_New->next;
33
             }
34
-         if (*cp = delim) cp++;
35
+         if ((*cp = delim)) cp++;
36
         }
37
 }
38
 
(-)sysutils/bbcp/files/patch-src_bbcp__NetAddr.C (+11 lines)
Line 0 Link Here
1
--- src/bbcp_NetAddr.C.orig	2015-01-14 20:13:30 UTC
2
+++ src/bbcp_NetAddr.C
3
@@ -49,7 +49,7 @@
4
 #ifndef s6_addr32
5
 #if   defined(SUN)
6
 #define s6_addr32 _S6_un._S6_u32
7
-#elif defined(MACOS)
8
+#elif defined(MACOS) || defined(FREEBSD)
9
 #define s6_addr32 __u6_addr.__u6_addr32
10
 #endif
11
 #endif
(-)sysutils/bbcp/files/patch-src_bbcp__NetAddrInfo.C (+11 lines)
Line 0 Link Here
1
--- src/bbcp_NetAddrInfo.C.orig	2015-01-14 20:14:07 UTC
2
+++ src/bbcp_NetAddrInfo.C
3
@@ -67,7 +67,7 @@
4
 #ifndef s6_addr32
5
 #if   defined(SUN)
6
 #define s6_addr32 _S6_un._S6_u32
7
-#elif defined(MACOS)
8
+#elif defined(MACOS) || defined(FREEBSD)
9
 #define s6_addr32 __u6_addr.__u6_addr32
10
 #endif
11
 #endif
(-)sysutils/bbcp/files/patch-src_bbcp__Node.C (+76 lines)
Line 0 Link Here
1
--- src/bbcp_Node.C.orig	2015-01-14 20:02:51 UTC
2
+++ src/bbcp_Node.C
3
@@ -94,7 +94,7 @@ void *bbcp_Connect(void *protp)
4
      bbcp_Link     *link;
5
      int            retc;
6
 
7
-     if (link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport))
8
+     if ((link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport)))
9
         {if ((retc = protocol->Login(link, 0)) < 0)
10
             {delete link; link = 0;}
11
         }
12
@@ -354,8 +354,8 @@ int bbcp_Node::RecvFile(bbcp_FileSpec *fp, bbcp_Node *
13
             oflag = O_WRONLY | O_CREAT | O_TRUNC;
14
            }
15
    else if (bbcp_Config.Options & bbcp_APPEND)
16
-           {if (retc = fp->WriteSigFile()) return retc;
17
-            if (startoff = fp->targetsz) oflag = O_WRONLY;
18
+           {if ((retc = fp->WriteSigFile())) return retc;
19
+            if ((startoff = fp->targetsz)) oflag = O_WRONLY;
20
                else oflag = O_CREAT | O_WRONLY;
21
            }
22
    else    oflag = O_WRONLY | O_CREAT | O_EXCL;
23
@@ -368,7 +368,7 @@ int bbcp_Node::RecvFile(bbcp_FileSpec *fp, bbcp_Node *
24
 
25
 // Tell the user what we are bout to do
26
 //
27
-   if (bbcp_Config.Options & bbcp_BLAB | bbcp_Config.Progint)
28
+   if ((bbcp_Config.Options & bbcp_BLAB) | bbcp_Config.Progint)
29
       if (bbcp_Config.Options & bbcp_APPEND)
30
          {char buff[32];
31
           sprintf(buff, "%lld", startoff);
32
@@ -464,7 +464,7 @@ int bbcp_Node::RecvFile(bbcp_FileSpec *fp, bbcp_Node *
33
 // Wait for the expansion thread to end
34
 //
35
    if (bbcp_Config.Options & bbcp_COMPRESS)
36
-      {if (tretc = (long)bbcp_Thread_Wait(cxp->TID)) retc = 128;
37
+      {if ((tretc = (long)bbcp_Thread_Wait(cxp->TID))) retc = 128;
38
        DEBUG("File expansion ended; rc=" <<tretc);
39
       }
40
 
41
@@ -478,7 +478,7 @@ int bbcp_Node::RecvFile(bbcp_FileSpec *fp, bbcp_Node *
42
 // Make sure each thread has terminated normally
43
 //
44
    for (i = 0; i < dlcount; i++)
45
-       {if (tretc = (long)bbcp_Thread_Wait(link_tid[i])) retc = 128;
46
+       {if ((tretc = (long)bbcp_Thread_Wait(link_tid[i]))) retc = 128;
47
         DEBUG("Thread " <<link_tid[i] <<" stream " <<i <<" ended; rc=" <<tretc);
48
        }
49
 
50
@@ -618,7 +618,7 @@ int bbcp_Node::SendFile(bbcp_FileSpec *fp)
51
 // Wait for compression thread to end
52
 //
53
    if (bbcp_Config.Options & bbcp_COMPRESS)
54
-      {if (tretc = (long)bbcp_Thread_Wait(cxp->TID)) retc = 128;
55
+      {if ((tretc = (long)bbcp_Thread_Wait(cxp->TID))) retc = 128;
56
        DEBUG("File compression ended; rc=" <<tretc);
57
        delete cxp;
58
       }
59
@@ -626,7 +626,7 @@ int bbcp_Node::SendFile(bbcp_FileSpec *fp)
60
 // Make sure each link thread has terminated normally.
61
 //
62
    for (i = 0; i < iocount; i++)
63
-       {if (tretc = (long)bbcp_Thread_Wait(link_tid[i])) retc = 128;
64
+       {if ((tretc = (long)bbcp_Thread_Wait(link_tid[i]))) retc = 128;
65
         DEBUG("Thread " <<link_tid[i] <<" stream " <<i <<" ended; rc=" <<tretc);
66
        }
67
 
68
@@ -735,7 +735,7 @@ int bbcp_Node::Outgoing(bbcp_Protocol *protocol)
69
 
70
 // Establish the control connection first
71
 //
72
-   if (link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport, 3))
73
+   if ((link = bbcp_Net.Connect(bbcp_Config.CBhost, bbcp_Config.CBport, 3)))
74
       if ((retc = protocol->Login(link, 0)) < 0)
75
          {delete link; link = 0;}
76
 
(-)sysutils/bbcp/files/patch-src_bbcp__ProcMon.C (+20 lines)
Line 0 Link Here
1
--- src/bbcp_ProcMon.C.orig	2015-01-14 20:04:50 UTC
2
+++ src/bbcp_ProcMon.C
3
@@ -132,7 +132,7 @@ void bbcp_ProcMon::Start(pid_t monit, bbcp_Node *Remot
4
 
5
 // Run a thread to start the monitor
6
 //
7
-   if (retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid))
8
+   if ((retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid)))
9
       {DEBUG("Error " <<retc <<" starting MonProc thread.");}
10
       else {DEBUG("Thread " <<mytid <<" monitoring process " <<monPID);}
11
    return;
12
@@ -154,7 +154,7 @@ void bbcp_ProcMon::Start(int seclim, bbcp_BuffPool *bu
13
 
14
 // Run a thread to start the monitor
15
 //
16
-   if (retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid))
17
+   if ((retc = bbcp_Thread_Run(bbcp_MonProc, (void *)this, &mytid)))
18
       {DEBUG("Error " <<retc <<" starting buffpool monitor thread.");}
19
       else {DEBUG("Thread " <<mytid <<" monitoring buffpool.");}
20
    return;
(-)sysutils/bbcp/files/patch-src_bbcp__ProgMon.C (+11 lines)
Line 0 Link Here
1
--- src/bbcp_ProgMon.C.orig	2015-01-14 20:04:40 UTC
2
+++ src/bbcp_ProgMon.C
3
@@ -146,7 +146,7 @@ void bbcp_ProgMon::Start(bbcp_File *fs_obj, bbcp_ZCX *
4
 
5
 // Run a thread to start the monitor
6
 //
7
-   if (retc = bbcp_Thread_Run(bbcp_MonProg, (void *)this, &mytid))
8
+   if ((retc = bbcp_Thread_Run(bbcp_MonProg, (void *)this, &mytid)))
9
       {DEBUG("Error " <<retc <<" starting progress monitor thread.");}
10
       else {DEBUG("Thread " <<mytid <<" monitoring progress.");}
11
    return;
(-)sysutils/bbcp/files/patch-src_bbcp__Protocol.C (+86 lines)
Line 0 Link Here
1
--- src/bbcp_Protocol.C.orig	2015-01-14 20:04:31 UTC
2
+++ src/bbcp_Protocol.C
3
@@ -86,7 +86,7 @@ int bbcp_Protocol::Schedule(bbcp_Node *Fnode, bbcp_Fil
4
 
5
 // Start-up the first node
6
 //
7
-   if (retc = Fnode->Run(Ffs->username, Ffs->hostname, Fcmd, Ftype))
8
+   if ((retc = Fnode->Run(Ffs->username, Ffs->hostname, Fcmd, Ftype)))
9
       return retc;
10
 
11
 // Determine additional options
12
@@ -101,15 +101,15 @@ int bbcp_Protocol::Schedule(bbcp_Node *Fnode, bbcp_Fil
13
 
14
 // Send the arguments
15
 //
16
-   if (retc = SendArgs(Fnode, Ffs, (char *)"none", 0, addOpt[0])) return retc;
17
+   if ((retc = SendArgs(Fnode, Ffs, (char *)"none", 0, addOpt[0]))) return retc;
18
 
19
 // Get the callback port from the first host
20
 //
21
-   if (retc = getCBPort(Fnode)) return retc;
22
+   if ((retc = getCBPort(Fnode))) return retc;
23
 
24
 // Start the second node
25
 //
26
-   if (retc = Lnode->Run(Lfs->username, Lfs->hostname, Lcmd, Ltype))
27
+   if ((retc = Lnode->Run(Lfs->username, Lfs->hostname, Lcmd, Ltype)))
28
       return retc;
29
 
30
 // Compute callback hostname and reset callback port
31
@@ -152,7 +152,7 @@ int bbcp_Protocol::getCBPort(bbcp_Node *Node)
32
 
33
 // The remote program should hve started, get the call back port
34
 //
35
-   if (wp = Node->GetLine())
36
+   if ((wp = Node->GetLine()))
37
       {if ((wp = Node->GetToken()) && !strcmp(wp, "200")
38
        &&  (wp = Node->GetToken()) && !strcmp(wp, "Port:")
39
        &&  (wp = Node->GetToken())
40
@@ -408,7 +408,7 @@ int bbcp_Protocol::Process_get()
41
 
42
 // Get the optional offset
43
 //
44
-   if (wp = Remote->GetToken())
45
+   if ((wp = Remote->GetToken()))
46
       {if (bbcp_Config.a2ll("file offset", wp, foffset, 0, -1)) return 22;
47
        if (foffset > fp->Info.size)
48
           {char buff[128];
49
@@ -447,7 +447,7 @@ int bbcp_Protocol::Process_login(bbcp_Link *Net)
50
 // Get the first line of the login stream
51
 //
52
    if (!(np->GetLine()))
53
-      {if (retc = np->LastError())
54
+      {if ((retc = np->LastError()))
55
           return bbcp_Emsg("Process_Login", retc, "processing login from",
56
                                  Net->LinkName());
57
        return bbcp_Fmsg("Process_Login", "Bad login from", Net->LinkName());
58
@@ -549,8 +549,8 @@ int bbcp_Protocol::Request(bbcp_Node *Node)
59
    if (texists && bbcp_Config.snkSpec->Info.Otype == 'd')
60
        tdir = bbcp_Config.snkSpec->pathname;
61
       else {int plen;
62
-            if (plen = bbcp_Config.snkSpec->filename -
63
-                       bbcp_Config.snkSpec->pathname)
64
+            if ((plen = bbcp_Config.snkSpec->filename -
65
+                       bbcp_Config.snkSpec->pathname))
66
                strncpy(buff, bbcp_Config.snkSpec->pathname, plen-1);
67
                else {buff[0] = '.'; plen = 2;}
68
             tdir = buff; buff[plen-1] = '\0';
69
@@ -562,7 +562,7 @@ int bbcp_Protocol::Request(bbcp_Node *Node)
70
       tdir_id = bbcp_Config.snkSpec->Info.fileid;
71
       else {bbcp_FileInfo Tinfo;
72
             if (!fs_obj || (!(retc = fs_obj->Stat(tdir, &Tinfo))
73
-            && Tinfo.Otype != 'd') && outDir) retc = ENOTDIR;
74
+            && (Tinfo.Otype != 'd') && outDir)) retc = ENOTDIR;
75
             if (retc) {bbcp_Fmsg("Request","Target directory",
76
                                  bbcp_Config.snkSpec->pathname,"not found");
77
                        return Request_exit(2, dRM);
78
@@ -925,7 +925,7 @@ void bbcp_Protocol::putCSV(char *Host, char *csFn, cha
79
 {                                //1234567890123
80
    struct iovec iov[] = {{(char *)"Checksum: ", 10},
81
                         {bbcp_Config.csName,strlen(bbcp_Config.csName)},
82
-                        {(char *)" ", 1}, {csVal, csVsz},
83
+                        {(char *)" ", 1}, {csVal, (unsigned long)csVsz},
84
                         {(char *)" ", 1}, {Host, strlen(Host)},
85
                         {(char *)":", 1}, {csFn, strlen(csFn)},
86
                         {(char *)"\n",1}};
(-)sysutils/bbcp/files/patch-src_bbcp__Pthread.C (+20 lines)
Line 0 Link Here
1
--- src/bbcp_Pthread.C.orig	2015-01-14 20:04:21 UTC
2
+++ src/bbcp_Pthread.C
3
@@ -128,7 +128,7 @@ int bbcp_CondVar::WaitMS(int msec)
4
 /*                              C o n d W a i t                               */
5
 /******************************************************************************/
6
 
7
-#if defined(MACOS) || defined(AIX)
8
+#if defined(MACOS) || defined(AIX) || defined(FREEBSD)
9
 
10
 int bbcp_Semaphore::CondWait()
11
 {
12
@@ -215,7 +215,7 @@ int  bbcp_Thread_Start(void *(*proc)(void *), void *ar
13
 void *bbcp_Thread_Wait(pthread_t tid)
14
     {long retc;
15
      void *tstat;
16
-     if (retc = pthread_join(tid, (void **)&tstat)) tstat = (void *)retc;
17
+     if ((retc = pthread_join(tid, (void **)&tstat))) tstat = (void *)retc;
18
      return tstat;
19
     }
20
 
(-)sysutils/bbcp/files/patch-src_bbcp__Pthread.h (+11 lines)
Line 0 Link Here
1
--- src/bbcp_Pthread.h.orig	2015-01-14 20:04:16 UTC
2
+++ src/bbcp_Pthread.h
3
@@ -108,7 +108,7 @@ void    UnLock() {if (monMutex) {monMutex->UnLock(); m
4
 bbcp_Mutex *monMutex;
5
 };
6
 
7
-#if defined(MACOS) || defined(AIX)
8
+#if defined(MACOS) || defined(AIX) || defined(FREEBSD)
9
 class bbcp_Semaphore
10
 {
11
 public:
(-)sysutils/bbcp/files/patch-src_bbcp__Stream.C (+20 lines)
Line 0 Link Here
1
--- src/bbcp_Stream.C.orig	2015-01-14 20:05:36 UTC
2
+++ src/bbcp_Stream.C
3
@@ -206,7 +206,7 @@ int bbcp_Stream::Exec(char **parm, int inrd, int inerr
4
            return bbcp_Emsg("Exec",errno,"creating a pipe for",parm[0]);
5
         Child_In=fildes_In[0]; Child_Out=fildes_Out[1]; Child_Err=fildes_Err[1];
6
         fildes_Out[1] = (inrd ? fildes_In[1] : -1);
7
-        if (retc = Attach(fildes_Out)) return retc;
8
+        if ((retc = Attach(fildes_Out))) return retc;
9
        }
10
 
11
     // Fork a process first so we can pick up the next request.
12
@@ -436,7 +436,7 @@ char *bbcp_Stream::GetWord(int lowcase)
13
      // If we have a token, return it
14
      //
15
      xline = 1;
16
-     if (wp = GetToken(lowcase)) return wp;
17
+     if ((wp = GetToken(lowcase))) return wp;
18
 
19
      // If no continuation allowed, return a null (but only once)
20
      //
(-)sysutils/bbcp/files/patch-src_bbcp__System.C (+47 lines)
Line 0 Link Here
1
--- src/bbcp_System.C.orig	2015-01-14 20:05:26 UTC
2
+++ src/bbcp_System.C
3
@@ -108,7 +108,7 @@ gid_t bbcp_System::getGID(const char *group)
4
 // Convert the group name to a gid
5
 //
6
    Glookup.Lock();
7
-   if (gp = getgrnam(group)) gid = gp->gr_gid;
8
+   if ((gp = getgrnam(group))) gid = gp->gr_gid;
9
       else gid = (gid_t)-1;
10
    Glookup.UnLock();
11
    return gid;
12
@@ -126,7 +126,7 @@ char *bbcp_System::getGNM(gid_t gid)
13
 // Get the group name
14
 //
15
    Glookup.Lock();
16
-   if (gp = getgrgid(gid)) gnmp = gp->gr_name;
17
+   if ((gp = getgrgid(gid))) gnmp = gp->gr_name;
18
       else gnmp = (char *)"nogroup";
19
    Glookup.UnLock();
20
 
21
@@ -151,7 +151,7 @@ char *bbcp_System::getHomeDir()
22
 
23
 // Get the password entry for this uid
24
 //
25
-   if (pwp = getpwuid(myuid)) homedir = pwp->pw_dir;
26
+   if ((pwp = getpwuid(myuid))) homedir = pwp->pw_dir;
27
       else homedir = (char *)"/tmp";
28
 
29
 // Return a copy of the directory
30
@@ -170,7 +170,7 @@ pid_t bbcp_System::getGrandP()
31
     int rc, grandpa;
32
 
33
     sprintf(cmd, PS_CMD, getppid());
34
-    if (rc = cmdstream.Exec(cmd)) rc = cmdstream.LastError();
35
+    if ((rc = cmdstream.Exec(cmd))) rc = cmdstream.LastError();
36
        else if (!cmdstream.GetLine() || !(lp = cmdstream.GetLine())) rc = -33;
37
                else {errno = 0;
38
                      grandpa = strtol(lp, (char **)NULL, 10);
39
@@ -218,7 +218,7 @@ char *bbcp_System::UserName()
40
 
41
 // Get the password entry for this uid
42
 //
43
-   if (pwp = getpwuid(myuid)) uname = pwp->pw_name;
44
+   if ((pwp = getpwuid(myuid))) uname = pwp->pw_name;
45
       else uname = (char *)"anonymous";
46
 
47
 // Return a copy of the directory
(-)sysutils/bbcp/files/patch-src_bbcp__ZCX.C (+11 lines)
Line 0 Link Here
1
--- src/bbcp_ZCX.C.orig	2015-01-14 20:06:03 UTC
2
+++ src/bbcp_ZCX.C
3
@@ -144,7 +144,7 @@ int bbcp_ZCX::Process()
4
 
5
 // If we have gotten here then all went well so far flush output
6
 //
7
-   if (obp->blen = outsz - ZStream.avail_out)
8
+   if ((obp->blen = outsz - ZStream.avail_out))
9
       {obp->boff = outbytes; outbytes += obp->blen;
10
        Obuff->putFullBuff(obp);
11
        if (!(obp = Obuff->getEmptyBuff())) return ENOBUFS;

Return to bug 229115