Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: zftp with Digital Unix



Hello

On big endian machines ntohs() and such are no-ops but for those of us 
who have to use little-endians they become important...

The patch below makes zftp work with Digital Unix on Alphas. The port is
already reported in network order by getservbyname(). This shouldn't
break anything on other machines. If it does we will need some `#if's.

Bye
 Sven

P.S.: Nice module, Peter.

*** os/Modules/zftp.c	Wed Dec 16 11:48:36 1998
--- Src/Modules/zftp.c	Wed Dec 16 13:27:53 1998
***************
*** 1650,1656 ****
  	zfsetparam("ZFTP_HOST", ztrdup(zhostp->h_name), ZFPM_READONLY);
      }
  
!     zsock.sin_port = ntohs(zservp->s_port);
      zcfd = zfmovefd(socket(zsock.sin_family, SOCK_STREAM, 0));
      if (zcfd < 0) {
  	zwarnnam(name, "socket failed: %e", NULL, errno);
--- 1650,1656 ----
  	zfsetparam("ZFTP_HOST", ztrdup(zhostp->h_name), ZFPM_READONLY);
      }
  
!     zsock.sin_port = zservp->s_port;
      zcfd = zfmovefd(socket(zsock.sin_family, SOCK_STREAM, 0));
      if (zcfd < 0) {
  	zwarnnam(name, "socket failed: %e", NULL, errno);

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author