home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnunet10.zip / source / patches next >
Text File  |  1996-07-27  |  14KB  |  592 lines

  1. *** f:/gcc/inetutils-1.0/libinetutils/localhost.c    Sat Jul 13 01:48:22 1996
  2. --- f:/gcc/inetutils/source/libinetutils/localhost.c    Sat Jul 27 12:32:06 1996
  3. ***************
  4. *** 22,27 ****
  5. --- 22,30 ----
  6.   #include <malloc.h>
  7.   #include <string.h>
  8.   #include <errno.h>
  9. + #ifdef __EMX__
  10. + # include <stdlib.h>
  11. + #endif
  12.   
  13.   /* Return the name of the localhost.  This is just a wrapper for gethostname,
  14.      which takes care of allocating a big enough buffer, and caches the result
  15. ***************
  16. *** 64,66 ****
  17. --- 67,79 ----
  18.   
  19.     return buf;
  20.   }
  21. + #ifdef __EMX__
  22. + int gethostname(char *buf,int buf_len)
  23. + {
  24. +     char *ptr=getenv("HOSTNAME");
  25. +     if (!ptr) return 1; /* HOST_NOT_FOUND from netdb.h */
  26. +     strncpy(buf,ptr,buf_len);
  27. +     return 0;
  28. + }
  29. + #endif /* __EMX__ */
  30.  
  31. *** f:/gcc/inetutils-1.0/libinetutils/stub_tgetent.c    Wed Jul 10 21:27:12 1996
  32. --- f:/gcc/inetutils/source/libinetutils/stub_tgetent.c    Sat Jul 27 12:20:46 1996
  33. ***************
  34. *** 1,7 ****
  35.   /* Return an error saying we couldn't find any termcap database.  */
  36.   int
  37. ! tgetent (buf, type)
  38. ! char *buf, *type
  39.   {
  40.     return -1;
  41.   }
  42. --- 1,6 ----
  43.   /* Return an error saying we couldn't find any termcap database.  */
  44.   int
  45. ! tgetent (char *buf, char *type)
  46.   {
  47.     return -1;
  48.   }
  49.  
  50. *** f:/gcc/inetutils-1.0/libinetutils/ttymsg.c    Thu Jan 04 00:45:38 1996
  51. --- f:/gcc/inetutils/source/libinetutils/ttymsg.c    Sat Jul 27 12:20:36 1996
  52. ***************
  53. *** 40,47 ****
  54.   #include <signal.h>
  55.   #include <fcntl.h>
  56.   #include <dirent.h>
  57. ! #include <errno.h>
  58. ! #include <paths.h>
  59.   #include <unistd.h>
  60.   #include <stdio.h>
  61.   #include <string.h>
  62. --- 40,49 ----
  63.   #include <signal.h>
  64.   #include <fcntl.h>
  65.   #include <dirent.h>
  66. ! # include <errno.h>
  67. ! #ifndef __EMX__
  68. ! # include <paths.h>
  69. ! #endif /* __EMX__ */
  70.   #include <unistd.h>
  71.   #include <stdio.h>
  72.   #include <string.h>
  73. ***************
  74. *** 61,66 ****
  75. --- 63,71 ----
  76.       char *line;
  77.       int tmout;
  78.   {
  79. + #ifdef __EMX__
  80. +         return "ttymsg() from libinetutils not supported in this port.\n";
  81. + #else
  82.       static char device[MAXNAMLEN] = _PATH_DEV;
  83.       static char errbuf[1024];
  84.       register int cnt, fd, left, wret;
  85. ***************
  86. *** 160,163 ****
  87. --- 165,169 ----
  88.       if (forked)
  89.           _exit(0);
  90.       return (NULL);
  91. + #endif /* __EMX__ */
  92.   }
  93. *** f:/gcc/inetutils-1.0/ftp/cmds.c    Thu Jul 11 01:18:14 1996
  94. --- f:/gcc/inetutils/source/ftp/cmds.c    Sat Jul 27 15:15:10 1996
  95. ***************
  96. *** 46,52 ****
  97. --- 46,54 ----
  98.   #include <arpa/ftp.h>
  99.   
  100.   #include <ctype.h>
  101. + #ifndef __EMX__
  102.   #include <err.h>
  103. + #endif
  104.   #include <errno.h>
  105.   #include <glob.h>
  106.   #include <netdb.h>
  107. ***************
  108. *** 56,65 ****
  109. --- 58,73 ----
  110.   #include <string.h>
  111.   #include <time.h>
  112.   #include <unistd.h>
  113. + #ifndef __EMX__
  114.   #include <paths.h>
  115. + #endif
  116.   
  117.   #include "ftp_var.h"
  118.   
  119. + #ifdef __EMX__
  120. + typedef void *sig_t;
  121. + #endif
  122.   #ifndef HAVE_STRDUP
  123.   static char *
  124.   strdup (str)
  125. ***************
  126. *** 613,619 ****
  127. --- 621,631 ----
  128.           }
  129.   
  130.           memset(&gl, 0, sizeof(gl));
  131. + #ifndef __EMX__
  132.           flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE;
  133. + #else /* __EMX__ */
  134. +         flags = GLOB_NOCHECK;
  135. + #endif
  136.   #ifdef GLOB_QUOTE
  137.           flags |= GLOB_QUOTE;
  138.   #endif
  139. ***************
  140. *** 892,897 ****
  141. --- 904,912 ----
  142.           return cp ? 0 : strdup (cp);
  143.       }
  144.       if (ftemp == NULL) {
  145. + #ifdef __EMX__
  146. + #define _PATH_TMP "./"            
  147. + #endif
  148.           char temp[sizeof _PATH_TMP + sizeof "XXXXXX"];
  149.   
  150.           strcpy (temp, _PATH_TMP);
  151. ***************
  152. *** 1408,1414 ****
  153. --- 1423,1433 ----
  154.       pid_t pid;
  155.       sig_t old1, old2;
  156.       char shellnam[40], *shell, *namep;
  157. + #ifndef __EMX__
  158.       union wait status;
  159. + #else /* __EMX__ */
  160. +         int status;
  161. + #endif /* __EMX__ */
  162.   
  163.       old1 = signal (SIGINT, SIG_IGN);
  164.       old2 = signal (SIGQUIT, SIG_IGN);
  165. ***************
  166. *** 1418,1425 ****
  167. --- 1437,1451 ----
  168.           (void) signal(SIGINT, SIG_DFL);
  169.           (void) signal(SIGQUIT, SIG_DFL);
  170.           shell = getenv("SHELL");
  171. + #ifdef __EMX__
  172. +                 if (shell==NULL) 
  173. +                     shell=getenv("COMSPEC");
  174. +                 if (shell==NULL)
  175. +                     shell="cmd.exe";
  176. + #else /* __EMX__ */
  177.           if (shell == NULL)
  178.               shell = _PATH_BSHELL;
  179. + #endif /* __EMX__ */
  180.           namep = strrchr(shell,'/');
  181.           if (namep == NULL)
  182.               namep = shell;
  183. ***************
  184. *** 1743,1750 ****
  185.   fatal(msg)
  186.       char *msg;
  187.   {
  188.       errx(1, "%s", msg);
  189.   }
  190.   
  191.   /*
  192. --- 1769,1780 ----
  193.   fatal(msg)
  194.       char *msg;
  195.   {
  196. ! #ifndef __EMX__
  197.       errx(1, "%s", msg);
  198. + #else
  199. +         printf("%s",msg);
  200. +         abort();
  201. + #endif
  202.   }
  203.   
  204.   /*
  205. ***************
  206. *** 1763,1769 ****
  207. --- 1793,1803 ----
  208.       if (!doglob)
  209.           return strdup (cp);
  210.   
  211. + #ifndef __EMX__
  212.       flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE;
  213. + #else
  214. +     flags = GLOB_NOCHECK;
  215. + #endif
  216.   #ifdef GLOB_QUOTE
  217.       flags |= GLOB_QUOTE;
  218.   #endif
  219.  
  220.  
  221.  
  222. *** f:/gcc/inetutils-1.0/ftp/extern.h    Mon Feb 12 18:30:22 1996
  223. --- f:/gcc/inetutils/source/ftp/extern.h    Sat Jul 27 15:08:14 1996
  224. ***************
  225. *** 36,41 ****
  226. --- 36,46 ----
  227.   struct timeval;
  228.   struct fd_set;
  229.   
  230. + #ifdef __EMX__
  231. + #define __P(a) a
  232. + #include <sys/types.h>
  233. + #endif
  234.   void    abort_remote __P((FILE *));
  235.   void    abortpt __P(());
  236.   void    abortrecv __P(());
  237. ***************
  238. *** 59,65 ****
  239. --- 64,74 ----
  240.   char   *domap __P((char *));
  241.   void    doproxy __P((int, char **));
  242.   char   *dotrans __P((char *));
  243. + #ifndef __EMX__
  244.   int     empty __P((fd_set *, int));
  245. + #else
  246. + int     empty __P((fd_set *, int));
  247. + #endif
  248.   void    fatal __P((char *));
  249.   void    get __P((int, char **));
  250.   struct cmd *getcmd __P((char *));
  251.  
  252.  
  253. *** f:/gcc/inetutils-1.0/ftp/ftp.c    Mon Feb 12 19:22:22 1996
  254. --- f:/gcc/inetutils/source/ftp/ftp.c    Sat Jul 27 15:18:20 1996
  255. ***************
  256. *** 54,60 ****
  257.   #include <arpa/telnet.h>
  258.   
  259.   #include <ctype.h>
  260. ! #include <err.h>
  261.   #include <errno.h>
  262.   #include <fcntl.h>
  263.   #include <netdb.h>
  264. --- 54,62 ----
  265.   #include <arpa/telnet.h>
  266.   
  267.   #include <ctype.h>
  268. ! #ifndef __EMX__
  269. ! # include <err.h>
  270. ! #endif
  271.   #include <errno.h>
  272.   #include <fcntl.h>
  273.   #include <netdb.h>
  274. ***************
  275. *** 68,73 ****
  276. --- 70,79 ----
  277.   
  278.   #include "ftp_var.h"
  279.   
  280. + #ifdef __EMX__
  281. + typedef void (*sig_t)(int);
  282. + #endif
  283.   extern int h_errno;
  284.   
  285.   struct    sockaddr_in hisctladdr;
  286. ***************
  287. *** 100,106 ****
  288. --- 106,116 ----
  289.       } else {
  290.           hp = gethostbyname(host);
  291.           if (hp == NULL) {
  292. + #ifndef __EMX__
  293.               warnx("%s: %s", host, hstrerror(h_errno));
  294. + #else
  295. +                         warnx("gethostbyname(): error (hstrerror not supported)\n");
  296. + #endif
  297.               code = -1;
  298.               return ((char *) 0);
  299.           }
  300. ***************
  301. *** 830,835 ****
  302. --- 840,846 ----
  303.           }
  304.           closefunc = fclose;
  305.       }
  306. + #ifndef __EMX__
  307.       if (fstat(fileno(fout), &st) < 0 || st.st_blksize == 0)
  308.           st.st_blksize = BUFSIZ;
  309.       if (st.st_blksize > bufsize) {
  310. ***************
  311. *** 843,848 ****
  312. --- 854,860 ----
  313.           }
  314.           bufsize = st.st_blksize;
  315.       }
  316. + #endif /* __EMX__ */
  317.       (void) gettimeofday(&start, (struct timezone *)0);
  318.       switch (curtype) {
  319.   
  320.  
  321.  
  322. *** f:/gcc/inetutils-1.0/ftp/main.c    Thu Jul 11 05:19:36 1996
  323. --- f:/gcc/inetutils/source/ftp/main.c    Sat Jul 27 15:25:04 1996
  324. ***************
  325. *** 51,57 ****
  326.   #include <arpa/ftp.h>
  327.   
  328.   #include <ctype.h>
  329. ! #include <err.h>
  330.   #include <netdb.h>
  331.   #include <pwd.h>
  332.   #include <signal.h>
  333. --- 51,59 ----
  334.   #include <arpa/ftp.h>
  335.   
  336.   #include <ctype.h>
  337. ! #ifndef __EMX__
  338. ! # include <err.h>
  339. ! #endif
  340.   #include <netdb.h>
  341.   #include <pwd.h>
  342.   #include <signal.h>
  343. ***************
  344. *** 66,72 ****
  345. --- 68,78 ----
  346.   #define USAGE "Usage: %s [OPTION...] [HOST [PORT]]\n"
  347.   
  348.   /* basename (argv[0]).  NetBSD, linux, & gnu libc all define it.  */
  349. + #ifndef __EMX__
  350.   extern char *__progname;
  351. + #else
  352. + char *__progname;
  353. + #endif
  354.   
  355.   /* Print a help message describing all options to STDOUT and exit with a
  356.      status of 0.  */
  357. ***************
  358. *** 125,133 ****
  359.       struct passwd *pw = NULL;
  360.       char *cp;
  361.   
  362.       sp = getservbyname("ftp", "tcp");
  363.       if (sp == 0)
  364. !         errx(1, "ftp/tcp: unknown service");
  365.       doglob = 1;
  366.       interactive = 1;
  367.       autologin = 1;
  368. --- 131,144 ----
  369.       struct passwd *pw = NULL;
  370.       char *cp;
  371.   
  372. + #ifdef __EMX__
  373. +         __progname=argv[0];
  374. + #endif
  375.       sp = getservbyname("ftp", "tcp");
  376.       if (sp == 0)
  377. !             errx(1, "ftp/tcp: unknown service");
  378.       doglob = 1;
  379.       interactive = 1;
  380.       autologin = 1;
  381.  
  382. *** f:/gcc/inetutils-1.0/ftp/ruserpass.c    Sat Jul 13 01:51:16 1996
  383. --- f:/gcc/inetutils/source/ftp/ruserpass.c    Sat Jul 27 15:08:14 1996
  384. ***************
  385. *** 39,45 ****
  386.   #include <sys/stat.h>
  387.   
  388.   #include <ctype.h>
  389. ! #include <err.h>
  390.   #include <errno.h>
  391.   #include <stdio.h>
  392.   #include <stdlib.h>
  393. --- 39,47 ----
  394.   #include <sys/stat.h>
  395.   
  396.   #include <ctype.h>
  397. ! #ifndef __EMX__
  398. ! # include <err.h>
  399. ! #endif
  400.   #include <errno.h>
  401.   #include <stdio.h>
  402.   #include <stdlib.h>
  403. *** f:/gcc/inetutils-1.0/telnet/commands.c    Sat Jul 13 02:14:20 1996
  404. --- f:/gcc/inetutils/source/telnet/commands.c    Sat Jul 27 14:02:04 1996
  405. ***************
  406. *** 36,53 ****
  407.   #endif /* not lint */
  408.   
  409.   #if    defined(unix)
  410. ! #include <sys/param.h>
  411. ! #if    defined(CRAY) || defined(sysV88)
  412. ! #include <sys/types.h>
  413. ! #endif
  414. ! #include <sys/file.h>
  415.   #else
  416. ! #include <sys/types.h>
  417.   #endif    /* defined(unix) */
  418.   #include <sys/socket.h>
  419.   #include <netinet/in.h>
  420.   #ifdef    CRAY
  421. ! #include <fcntl.h>
  422.   #endif    /* CRAY */
  423.   
  424.   #include <signal.h>
  425. --- 36,53 ----
  426.   #endif /* not lint */
  427.   
  428.   #if    defined(unix)
  429. ! # include <sys/param.h>
  430. ! # if    defined(CRAY) || defined(sysV88)
  431. ! #  include <sys/types.h>
  432. ! # endif
  433. ! # include <sys/file.h>
  434.   #else
  435. ! # include <sys/types.h>
  436.   #endif    /* defined(unix) */
  437.   #include <sys/socket.h>
  438.   #include <netinet/in.h>
  439.   #ifdef    CRAY
  440. ! # include <fcntl.h>
  441.   #endif    /* CRAY */
  442.   
  443.   #include <signal.h>
  444. ***************
  445. *** 1390,1395 ****
  446. --- 1390,1399 ----
  447.       int argc;
  448.       char *argv[];
  449.   {
  450. + #ifdef __EMX__
  451. +     fprintf(stderr,"This port does not support shells.\n");
  452. +     return 1;
  453. + #else
  454.       long oldrows, oldcols, newrows, newcols, err;
  455.   
  456.       setcommandmode();
  457. ***************
  458. *** 1432,1437 ****
  459. --- 1436,1442 ----
  460.           break;
  461.       }
  462.       return 1;
  463. + #endif /* __EMX__ */
  464.   }
  465.   #else    /* !defined(TN3270) */
  466.   extern int shell();
  467. ***************
  468. *** 2412,2418 ****
  469.   #endif
  470.   #if    defined(IPPROTO_IP) && defined(IP_TOS)
  471.       {
  472. ! # if    defined(HAS_GETTOS)
  473.           struct tosent *tp;
  474.           if (tos < 0 && (tp = gettosbyname("telnet", "tcp")))
  475.           tos = tp->t_tos;
  476. --- 2417,2423 ----
  477.   #endif
  478.   #if    defined(IPPROTO_IP) && defined(IP_TOS)
  479.       {
  480. ! # if    defined(HAS_GETTOS) && !defined(__EMX__)
  481.           struct tosent *tp;
  482.           if (tos < 0 && (tp = gettosbyname("telnet", "tcp")))
  483.           tos = tp->t_tos;
  484. ***************
  485. *** 2839,2844 ****
  486. --- 2844,2853 ----
  487.       char    **cpp;
  488.       int    *lenp;
  489.   {
  490. + #ifdef __EMX__
  491. +         fprintf(stderr,"sourceroute() not functional in this port.\n");
  492. +         return -1;
  493. + #else
  494.       static char lsr[44];
  495.   #ifdef    sysV88
  496.       static IOPTN ipopt;
  497. ***************
  498. *** 2965,2969 ****
  499. --- 2974,2979 ----
  500.       *cpp = (char *) &ipopt;
  501.   #endif
  502.       return(sin_addr.s_addr);
  503. + #endif /* EMX */
  504.   }
  505.   #endif
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512. *** f:/gcc/inetutils-1.0/telnet/main.c    Thu Jul 11 04:49:34 1996
  513. --- f:/gcc/inetutils/source/telnet/main.c    Sat Jul 27 14:29:02 1996
  514. ***************
  515. *** 129,135 ****
  516.   #endif
  517.   
  518.   #if defined (ENCRYPTION) || defined (AUTHENTICATION) || defined (TN3270)
  519. !   putc ('\n');
  520.   #endif
  521.   
  522.     puts ("\
  523. --- 129,135 ----
  524.   #endif
  525.   
  526.   #if defined (ENCRYPTION) || defined (AUTHENTICATION) || defined (TN3270)
  527. !   putc ('\n',stdout);
  528.   #endif
  529.   
  530.     puts ("\
  531. ***************
  532. *** 233,239 ****
  533.               break;
  534.           case 'S':
  535.               {
  536. ! #ifdef    HAS_GETTOS
  537.               extern int tos;
  538.   
  539.               if ((tos = parsetos(optarg, "tcp")) < 0)
  540. --- 233,239 ----
  541.               break;
  542.           case 'S':
  543.               {
  544. ! #if defined(HAS_GETTOS) && !defined(__EMX__)
  545.               extern int tos;
  546.   
  547.               if ((tos = parsetos(optarg, "tcp")) < 0)
  548.  
  549.  
  550.  
  551.  
  552. *** f:/gcc/inetutils-1.0/telnet/sys_bsd.c    Mon Feb 12 18:30:54 1996
  553. --- f:/gcc/inetutils/source/telnet/sys_bsd.c    Sat Jul 27 14:29:02 1996
  554. ***************
  555. *** 404,410 ****
  556.        * left to write out, it returns -1 if it couldn't do
  557.        * anything at all, otherwise it returns 1 + the number
  558.        * of characters left to write.
  559. ! #ifndef    USE_TERMIO
  560.        * We would really like ask the kernel to wait for the output
  561.        * to drain, like we can do with the TCSADRAIN, but we don't have
  562.        * that option.  The only ioctl that waits for the output to
  563. --- 404,410 ----
  564.        * left to write out, it returns -1 if it couldn't do
  565.        * anything at all, otherwise it returns 1 + the number
  566.        * of characters left to write.
  567. ! def    USE_TERMIO
  568.        * We would really like ask the kernel to wait for the output
  569.        * to drain, like we can do with the TCSADRAIN, but we don't have
  570.        * that option.  The only ioctl that waits for the output to
  571. ***************
  572. *** 684,689 ****
  573. --- 684,694 ----
  574.       ioctl(tin, TIOCSETC, (char *)&tc);
  575.       ioctl(tin, TIOCSETN, (char *)&sb);
  576.   #else
  577. + #ifdef __EMX__
  578. +     tmp_tc.c_lflag &= ~IDEFAULT;
  579. + #endif
  580.       if (tcsetattr(tin, TCSADRAIN, &tmp_tc) < 0)
  581.       tcsetattr(tin, TCSANOW, &tmp_tc);
  582.   #endif
  583.