components/lftp/patches/sun_collision.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 11 Mar 2013 10:38:09 -0700
branchs11-update
changeset 2520 ceec631e74d1
parent 406 f556f16e55d2
permissions -rw-r--r--
Close of build 10.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
406
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     1
--- src/attach.h.orig	Fri Jun 17 05:58:31 2011
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     2
+++ src/attach.h	Wed Jul 13 01:57:06 2011
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     3
@@ -88,9 +88,9 @@
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     4
 	    TimeoutS(1);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     5
 	    return m;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     6
 	 }
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     7
-	 struct sockaddr_un sun;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     8
-	 socklen_t sa_len=sizeof(sun);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
     9
-	 a_sock=accept(sock,(sockaddr*)&sun,&sa_len);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    10
+	 struct sockaddr_un un;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    11
+	 socklen_t sa_len=sizeof(un);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    12
+	 a_sock=accept(sock,(sockaddr*)&un,&sa_len);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    13
 	 if(a_sock==-1 && E_RETRY(errno)) {
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    14
 	    Block(sock,POLLIN);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    15
 	    return m;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    16
@@ -161,11 +161,11 @@
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    17
 	 int fl=fcntl(sock,F_GETFL);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    18
 	 fcntl(sock,F_SETFL,fl|O_NONBLOCK);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    19
 	 fcntl(sock,F_SETFD,FD_CLOEXEC);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    20
-	 struct sockaddr_un sun;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    21
-	 memset(&sun,0,sizeof(sun));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    22
-	 sun.sun_family=AF_UNIX;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    23
-	 strncpy(sun.sun_path,path,sizeof(sun.sun_path));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    24
-	 if(bind(sock,(sockaddr*)&sun,SUN_LEN(&sun))==-1) {
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    25
+	 struct sockaddr_un un;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    26
+	 memset(&un,0,sizeof(un));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    27
+	 un.sun_family=AF_UNIX;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    28
+	 strncpy(un.sun_path,path,sizeof(un.sun_path));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    29
+	 if(bind(sock,(sockaddr*)&un,SUN_LEN(&un))==-1) {
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    30
 	    perror("bind");
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    31
 	    close(sock);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    32
 	    sock=-1;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    33
@@ -219,12 +219,12 @@
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    34
 	 m=MOVED;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    35
       }
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    36
       if(!connected) {
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    37
-	 struct sockaddr_un sun;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    38
-	 memset(&sun,0,sizeof(sun));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    39
-	 sun.sun_family=AF_UNIX;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    40
+	 struct sockaddr_un un;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    41
+	 memset(&un,0,sizeof(un));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    42
+	 un.sun_family=AF_UNIX;
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    43
 	 const char *path=AcceptTermFD::get_sock_path(pid);
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    44
-	 strncpy(sun.sun_path,path,sizeof(sun.sun_path));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    45
-	 int res=connect(sock,(sockaddr*)&sun,SUN_LEN(&sun));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    46
+	 strncpy(un.sun_path,path,sizeof(un.sun_path));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    47
+	 int res=connect(sock,(sockaddr*)&un,SUN_LEN(&un));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    48
 	 if(res==-1 && !NonFatalError(errno)) {
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    49
 	    error=Error::Fatal(xstring::format("connect(%s): %s",path,strerror(errno)));
f556f16e55d2 7018539 Problem with utility/lftp
Petr Sumbera <petr.sumbera@oracle.com>
parents:
diff changeset
    50
 	    return MOVED;