home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / cvs-1.8.7-src.tgz / tar.out / fsf / cvs / macintosh / maccvs165.patch < prev    next >
Text File  |  1996-09-28  |  67KB  |  2,510 lines

  1. diff -r -C 2 -P base/cvs-1.6.5/ChangeLog cvs-1.6.5/ChangeLog
  2. *** base/cvs-1.6.5/ChangeLog    Tue Jan  9 06:20:05 1996
  3. --- cvs-1.6.5/ChangeLog    Wed Jan 10 13:41:54 1996
  4. ***************
  5. *** 1,2 ****
  6. --- 1,12 ----
  7. + Tue Jan  9 12:39:22 1995 Mike Ladwig <mike@twinpeaks.prc.com>
  8. +     * Port of CVS (CVS 1.6.5 snapshot 1/9/96) to MacOS 7.x
  9. +     * Virtually all "cvs base" changes are to wrap filesystem calls
  10. +       (e.g. CVS_FOPEN) to allow for pathname changes and permission
  11. +       parameter removal
  12. +     * Mac-specific code (rcmd port, fs stuff) all in 'macintosh' subdir
  13. +     * Build requires CW GUSI 1.6.4 and CodeWarrier 7
  14. +     * 'release' doesn't work, due to cvs implementation approach
  15.   Mon Jan  8 11:42:40 1996  Jim Kingdon  <kingdon@harvey.cyclic.com>
  16.   
  17. diff -r -C 2 -P base/cvs-1.6.5/lib/regex.c cvs-1.6.5/lib/regex.c
  18. *** base/cvs-1.6.5/lib/regex.c    Tue Oct 10 07:20:24 1995
  19. --- cvs-1.6.5/lib/regex.c    Tue Jan  9 05:33:05 1996
  20. ***************
  21. *** 231,236 ****
  22. --- 231,240 ----
  23.   #define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
  24.   
  25. + #ifndef MAX
  26.   #define MAX(a, b) ((a) > (b) ? (a) : (b))
  27. + #endif
  28. + #ifndef MIN
  29.   #define MIN(a, b) ((a) < (b) ? (a) : (b))
  30. + #endif
  31.   
  32.   typedef char boolean;
  33. diff -r -C 2 -P base/cvs-1.6.5/lib/save-cwd.c cvs-1.6.5/lib/save-cwd.c
  34. *** base/cvs-1.6.5/lib/save-cwd.c    Sat Oct 28 07:20:10 1995
  35. --- cvs-1.6.5/lib/save-cwd.c    Wed Jan 10 13:22:50 1996
  36. ***************
  37. *** 122,126 ****
  38.       }
  39.       }
  40. !   else if (chdir (cwd->name) < 0)
  41.       {
  42.         error (0, errno, "%s", cwd->name);
  43. --- 122,126 ----
  44.       }
  45.       }
  46. !   else if (CVS_CHDIR (cwd->name) < 0)
  47.       {
  48.         error (0, errno, "%s", cwd->name);
  49. diff -r -C 2 -P base/cvs-1.6.5/lib/system.h cvs-1.6.5/lib/system.h
  50. *** base/cvs-1.6.5/lib/system.h    Thu Jan  4 06:20:14 1996
  51. --- cvs-1.6.5/lib/system.h    Tue Jan  9 05:33:06 1996
  52. ***************
  53. *** 434,443 ****
  54.   #endif
  55.   
  56. ! /* Under MS-DOS and its derivatives (like Windows NT), mkdir takes only one
  57. !    argument; permission is handled very differently on those systems than in
  58. !    in Unix.  So we leave such systems a hook on which they can hang their
  59. !    own definitions.  */
  60.   #ifndef CVS_MKDIR
  61.   #define CVS_MKDIR mkdir
  62.   #endif
  63.   
  64. --- 434,483 ----
  65.   #endif
  66.   
  67. ! /* Under non-UNIX operating systems (MS-DOS, WinNT, MacOS), many filesystem
  68. !    calls take  only one argument; permission is handled very differently on
  69. !    those systems than in Unix.  So we leave such systems a hook on which they
  70. !    can hang their own definitions.  */
  71.   #ifndef CVS_MKDIR
  72.   #define CVS_MKDIR mkdir
  73. + #endif
  74. + #ifndef CVS_MKDIR
  75. + #define CVS_MKDIR mkdir
  76. + #endif
  77. + #ifndef CVS_OPEN
  78. + #define CVS_OPEN open
  79. + #endif
  80. + #ifndef CVS_CREAT
  81. + #define CVS_CREAT creat
  82. + #endif
  83. + #ifndef CVS_FOPEN
  84. + #define CVS_FOPEN fopen
  85. + #endif
  86. + #ifndef CVS_CHDIR
  87. + #define CVS_CHDIR chdir
  88. + #endif
  89. + #ifndef CVS_ACCESS
  90. + #define CVS_ACCESS access
  91. + #endif
  92. + #ifndef CVS_OPENDIR
  93. + #define CVS_OPENDIR opendir
  94. + #endif
  95. + #ifndef CVS_STAT
  96. + #define CVS_STAT stat
  97. + #endif
  98. + #ifndef CVS_RENAME
  99. + #define CVS_RENAME rename
  100. + #endif
  101. + #ifndef CVS_UNLINK
  102. + #define CVS_UNLINK unlink
  103.   #endif
  104.   
  105. diff -r -C 2 -P base/cvs-1.6.5/src/add.c cvs-1.6.5/src/add.c
  106. *** base/cvs-1.6.5/src/add.c    Thu Jan  4 06:20:24 1996
  107. --- cvs-1.6.5/src/add.c    Tue Jan  9 05:33:07 1996
  108. ***************
  109. *** 381,385 ****
  110.       if (save_cwd (&cwd))
  111.       return (1);
  112. !     if (chdir (dir) < 0)
  113.       {
  114.       error (0, errno, "cannot chdir to %s", dir);
  115. --- 381,385 ----
  116.       if (save_cwd (&cwd))
  117.       return (1);
  118. !     if (CVS_CHDIR (dir) < 0)
  119.       {
  120.       error (0, errno, "cannot chdir to %s", dir);
  121. diff -r -C 2 -P base/cvs-1.6.5/src/checkout.c cvs-1.6.5/src/checkout.c
  122. *** base/cvs-1.6.5/src/checkout.c    Thu Jan  4 06:20:25 1996
  123. --- cvs-1.6.5/src/checkout.c    Tue Jan  9 05:33:07 1996
  124. ***************
  125. *** 351,355 ****
  126.   
  127.       (void) CVS_MKDIR (where, 0777);
  128. !     if (chdir (where) < 0)
  129.           error (1, errno, "cannot chdir to %s", where);
  130.       preload_update_dir = xstrdup (where);
  131. --- 351,355 ----
  132.   
  133.       (void) CVS_MKDIR (where, 0777);
  134. !     if (CVS_CHDIR (where) < 0)
  135.           error (1, errno, "cannot chdir to %s", where);
  136.       preload_update_dir = xstrdup (where);
  137. ***************
  138. *** 402,406 ****
  139.       *slash = '\0';
  140.   
  141. !     if (chdir (where) < 0)
  142.           error (1, errno, "cannot chdir to %s", where);
  143.   
  144. --- 402,406 ----
  145.       *slash = '\0';
  146.   
  147. !     if (CVS_CHDIR (where) < 0)
  148.           error (1, errno, "cannot chdir to %s", where);
  149.   
  150. ***************
  151. *** 716,720 ****
  152.       if (pipeout)
  153.       {
  154. !     if (chdir (repository) < 0)
  155.       {
  156.           error (0, errno, "cannot chdir to %s", repository);
  157. --- 716,720 ----
  158.       if (pipeout)
  159.       {
  160. !     if (CVS_CHDIR (repository) < 0)
  161.       {
  162.           error (0, errno, "cannot chdir to %s", repository);
  163. ***************
  164. *** 855,859 ****
  165.       *slash2 = '\0';
  166.       (void) CVS_MKDIR (cp, 0777);
  167. !     if (chdir (cp) < 0)
  168.       {
  169.           error (0, errno, "cannot chdir to %s", cp);
  170. --- 855,859 ----
  171.       *slash2 = '\0';
  172.       (void) CVS_MKDIR (cp, 0777);
  173. !     if (CVS_CHDIR (cp) < 0)
  174.       {
  175.           error (0, errno, "cannot chdir to %s", cp);
  176. ***************
  177. *** 883,887 ****
  178.       }
  179.       (void) CVS_MKDIR (cp, 0777);
  180. !     if (chdir (cp) < 0)
  181.       {
  182.       error (0, errno, "cannot chdir to %s", cp);
  183. --- 883,887 ----
  184.       }
  185.       (void) CVS_MKDIR (cp, 0777);
  186. !     if (CVS_CHDIR (cp) < 0)
  187.       {
  188.       error (0, errno, "cannot chdir to %s", cp);
  189. diff -r -C 2 -P base/cvs-1.6.5/src/client.c cvs-1.6.5/src/client.c
  190. *** base/cvs-1.6.5/src/client.c    Tue Jan  9 06:20:21 1996
  191. --- cvs-1.6.5/src/client.c    Tue Jan  9 05:33:07 1996
  192. ***************
  193. *** 375,382 ****
  194.           error (1, 0, "premature end of file from server");
  195.       }
  196. -     if (c == '\n')
  197. -         break;
  198.       
  199.       result[input_index++] = c;
  200.       while (input_index + 1 >= result_size)
  201. --- 375,382 ----
  202.           error (1, 0, "premature end of file from server");
  203.       }
  204.       
  205. +     if (c == '\012')
  206. +         break;
  207.       result[input_index++] = c;
  208.       while (input_index + 1 >= result_size)
  209. ***************
  210. *** 691,697 ****
  211.                  "could not get working directory: %s", toplevel_wd);
  212.   
  213. !     if (chdir (toplevel_wd) < 0)
  214.           error (1, errno, "could not chdir to %s", toplevel_wd);
  215. !     if (chdir (dirname) < 0)
  216.       {
  217.           char *dir;
  218. --- 691,697 ----
  219.                  "could not get working directory: %s", toplevel_wd);
  220.   
  221. !     if (CVS_CHDIR (toplevel_wd) < 0)
  222.           error (1, errno, "could not chdir to %s", toplevel_wd);
  223. !     if (CVS_CHDIR (dirname) < 0)
  224.       {
  225.           char *dir;
  226. ***************
  227. *** 838,842 ****
  228.           free (dir);
  229.           /* Now it better work.  */
  230. !         if (chdir (dirname) < 0)
  231.           error (1, errno, "could not chdir to %s", dirname);
  232.       }
  233. --- 838,842 ----
  234.           free (dir);
  235.           /* Now it better work.  */
  236. !         if (CVS_CHDIR (dirname) < 0)
  237.           error (1, errno, "could not chdir to %s", dirname);
  238.       }
  239. ***************
  240. *** 1087,1091 ****
  241.             bin = 0;
  242.   
  243. !         fd = open (temp_filename,
  244.                      O_WRONLY | O_CREAT | O_TRUNC | (bin ? OPEN_BINARY : 0),
  245.                      0777);
  246. --- 1087,1091 ----
  247.             bin = 0;
  248.   
  249. !         fd = CVS_OPEN (temp_filename,
  250.                      O_WRONLY | O_CREAT | O_TRUNC | (bin ? OPEN_BINARY : 0),
  251.                      0777);
  252. ***************
  253. *** 1134,1138 ****
  254.               convert_file (temp_filename, O_RDONLY | OPEN_BINARY,
  255.                         filename, O_WRONLY | O_CREAT | O_TRUNC);
  256. !             if (unlink (temp_filename) < 0)
  257.                   error (0, errno, "warning: couldn't delete %s",
  258.                              temp_filename);
  259. --- 1134,1138 ----
  260.               convert_file (temp_filename, O_RDONLY | OPEN_BINARY,
  261.                         filename, O_WRONLY | O_CREAT | O_TRUNC);
  262. !             if (CVS_UNLINK (temp_filename) < 0)
  263.                   error (0, errno, "warning: couldn't delete %s",
  264.                              temp_filename);
  265. ***************
  266. *** 1156,1160 ****
  267.               error (1, 0, "patch original file %s does not exist",
  268.                  short_pathname);
  269. !         if (stat (temp_filename, &s) < 0)
  270.               error (1, 1, "can't stat patch file %s", temp_filename);
  271.           if (s.st_size == 0)
  272. --- 1156,1160 ----
  273.               error (1, 0, "patch original file %s does not exist",
  274.                  short_pathname);
  275. !         if (CVS_STAT (temp_filename, &s) < 0)
  276.               error (1, 1, "can't stat patch file %s", temp_filename);
  277.           if (s.st_size == 0)
  278. ***************
  279. *** 1227,1231 ****
  280.            * way they were transmitted.
  281.            */
  282. !         e = fopen (filename, "r");
  283.           if (e == NULL)
  284.               error (1, errno, "could not open %s", short_pathname);
  285. --- 1227,1231 ----
  286.            * way they were transmitted.
  287.            */
  288. !         e = CVS_FOPEN (filename, "r");
  289.           if (e == NULL)
  290.               error (1, errno, "could not open %s", short_pathname);
  291. ***************
  292. *** 1639,1643 ****
  293.       if (toplevel_wd[0] != '\0')
  294.         {
  295. !     if (chdir (toplevel_wd) < 0)
  296.         error (1, errno, "could not chdir to %s", toplevel_wd);
  297.         }
  298. --- 1639,1643 ----
  299.       if (toplevel_wd[0] != '\0')
  300.         {
  301. !     if (CVS_CHDIR (toplevel_wd) < 0)
  302.         error (1, errno, "could not chdir to %s", toplevel_wd);
  303.         }
  304. ***************
  305. *** 1685,1689 ****
  306.       struct dirent *dp;
  307.   
  308. !     if ((dirp = opendir (dir)) == NULL)
  309.       {
  310.       if (! existence_error (errno))
  311. --- 1685,1689 ----
  312.       struct dirent *dp;
  313.   
  314. !     if ((dirp = CVS_OPENDIR (dir)) == NULL)
  315.       {
  316.       if (! existence_error (errno))
  317. ***************
  318. *** 1742,1746 ****
  319.       if (toplevel_wd[0] != '\0')
  320.         {
  321. !     if (chdir (toplevel_wd) < 0)
  322.         error (1, errno, "could not chdir to %s", toplevel_wd);
  323.         }
  324. --- 1742,1746 ----
  325.       if (toplevel_wd[0] != '\0')
  326.         {
  327. !     if (CVS_CHDIR (toplevel_wd) < 0)
  328.         error (1, errno, "could not chdir to %s", toplevel_wd);
  329.         }
  330. ***************
  331. *** 1828,1832 ****
  332.           sprintf (adm_name, "%s/%s", dir, CVSADM_TAG);
  333.   
  334. !     f = fopen (adm_name, "r");
  335.       if (f == NULL)
  336.       {
  337. --- 1828,1832 ----
  338.           sprintf (adm_name, "%s/%s", dir, CVSADM_TAG);
  339.   
  340. !     f = CVS_FOPEN (adm_name, "r");
  341.       if (f == NULL)
  342.       {
  343. ***************
  344. *** 1860,1864 ****
  345.           sprintf (adm_name, "%s/%s", dir, CVSADM_CIPROG);
  346.   
  347. !     f = fopen (adm_name, "r");
  348.       if (f == NULL)
  349.       {
  350. --- 1860,1864 ----
  351.           sprintf (adm_name, "%s/%s", dir, CVSADM_CIPROG);
  352.   
  353. !     f = CVS_FOPEN (adm_name, "r");
  354.       if (f == NULL)
  355.       {
  356. ***************
  357. *** 1895,1899 ****
  358.           sprintf (adm_name, "%s/%s", dir, CVSADM_UPROG);
  359.   
  360. !     f = fopen (adm_name, "r");
  361.       if (f == NULL)
  362.       {
  363. --- 1895,1899 ----
  364.           sprintf (adm_name, "%s/%s", dir, CVSADM_UPROG);
  365.   
  366. !     f = CVS_FOPEN (adm_name, "r");
  367.       if (f == NULL)
  368.       {
  369. ***************
  370. *** 3181,3185 ****
  371.   
  372.       /* Don't think we can assume fstat exists.  */
  373. !     if (stat (file, &sb) < 0)
  374.       error (1, errno, "reading %s", short_pathname);
  375.   
  376. --- 3181,3185 ----
  377.   
  378.       /* Don't think we can assume fstat exists.  */
  379. !     if (CVS_STAT (file, &sb) < 0)
  380.       error (1, errno, "reading %s", short_pathname);
  381.   
  382. ***************
  383. *** 3202,3206 ****
  384.         bin = 0;
  385.   
  386. !     fd = open (file, O_RDONLY | (bin ? OPEN_BINARY : 0));
  387.   
  388.       if (fd < 0)
  389. --- 3202,3206 ----
  390.         bin = 0;
  391.   
  392. !     fd = CVS_OPEN (file, O_RDONLY | (bin ? OPEN_BINARY : 0));
  393.   
  394.       if (fd < 0)
  395. ***************
  396. *** 3256,3260 ****
  397.              the translation mode to created processes via environment
  398.              variables, ick.  */
  399. !         fd = open (tempfile, O_RDONLY | OPEN_BINARY);
  400.           if (fd < 0)
  401.           error (1, errno, "reading %s", short_pathname);
  402. --- 3256,3260 ----
  403.              the translation mode to created processes via environment
  404.              variables, ick.  */
  405. !         fd = CVS_OPEN (tempfile, O_RDONLY | OPEN_BINARY);
  406.           if (fd < 0)
  407.           error (1, errno, "reading %s", short_pathname);
  408. ***************
  409. *** 3297,3301 ****
  410.       if (converting)
  411.       {
  412. !         if (unlink (tempfile) < 0)
  413.           error (0, errno,
  414.                  "warning: can't remove temp file %s", tempfile);
  415. --- 3297,3301 ----
  416.       if (converting)
  417.       {
  418. !         if (CVS_UNLINK (tempfile) < 0)
  419.           error (0, errno,
  420.                  "warning: can't remove temp file %s", tempfile);
  421. ***************
  422. *** 3800,3804 ****
  423.           if (fclose (fp) < 0)
  424.           error (0, errno, "cannot close %s", CVSADM_NOTIFY);
  425. !         if (unlink (CVSADM_NOTIFY) < 0)
  426.           error (0, errno, "cannot remove %s", CVSADM_NOTIFY);
  427.           return;
  428. --- 3800,3804 ----
  429.           if (fclose (fp) < 0)
  430.           error (0, errno, "cannot close %s", CVSADM_NOTIFY);
  431. !         if (CVS_UNLINK (CVSADM_NOTIFY) < 0)
  432.           error (0, errno, "cannot remove %s", CVSADM_NOTIFY);
  433.           return;
  434. ***************
  435. *** 3845,3849 ****
  436.       return;
  437.       }
  438. !     if (rename (CVSADM_NOTIFYTMP, CVSADM_NOTIFY) < 0)
  439.       error (0, errno, "cannot rename %s to %s", CVSADM_NOTIFYTMP,
  440.              CVSADM_NOTIFY);
  441. --- 3845,3849 ----
  442.       return;
  443.       }
  444. !     if (CVS_RENAME (CVSADM_NOTIFYTMP, CVSADM_NOTIFY) < 0)
  445.       error (0, errno, "cannot rename %s to %s", CVSADM_NOTIFYTMP,
  446.              CVSADM_NOTIFY);
  447. diff -r -C 2 -P base/cvs-1.6.5/src/commit.c cvs-1.6.5/src/commit.c
  448. *** base/cvs-1.6.5/src/commit.c    Fri Jan  5 06:20:20 1996
  449. --- cvs-1.6.5/src/commit.c    Tue Jan  9 05:33:07 1996
  450. ***************
  451. *** 297,301 ****
  452.           error (1, 0, "cannot specify both a message and a log file");
  453.   
  454. !     if ((logfd = open (logfile, O_RDONLY | OPEN_BINARY)) < 0)
  455.           error (1, errno, "cannot open log file %s", logfile);
  456.   
  457. --- 297,301 ----
  458.           error (1, 0, "cannot specify both a message and a log file");
  459.   
  460. !     if ((logfd = CVS_OPEN (logfile, O_RDONLY | OPEN_BINARY)) < 0)
  461.           error (1, errno, "cannot open log file %s", logfile);
  462.   
  463. ***************
  464. *** 1088,1092 ****
  465.       FILE *fp;
  466.   
  467. !     if ((fp = fopen (CVSADM_CIPROG, "r")) != NULL)
  468.       {
  469.           char *line;
  470. --- 1088,1092 ----
  471.       FILE *fp;
  472.   
  473. !     if ((fp = CVS_FOPEN (CVSADM_CIPROG, "r")) != NULL)
  474.       {
  475.           char *line;
  476. ***************
  477. *** 1414,1418 ****
  478.   #ifdef DEATH_SUPPORT
  479.       if (strcmp (rcs, tmp) != 0
  480. !         && rename (rcs, tmp) == -1
  481.           && (isreadable (rcs) || !isreadable (tmp)))
  482.       {
  483. --- 1414,1418 ----
  484.   #ifdef DEATH_SUPPORT
  485.       if (strcmp (rcs, tmp) != 0
  486. !         && CVS_RENAME (rcs, tmp) == -1
  487.           && (isreadable (rcs) || !isreadable (tmp)))
  488.       {
  489. ***************
  490. *** 1434,1438 ****
  491.   #else /* No DEATH_SUPPORT */
  492.   
  493. !     if ((strcmp (rcs, tmp) == 0 || rename (rcs, tmp) != -1) ||
  494.           (!isreadable (rcs) && isreadable (tmp)))
  495.        {
  496. --- 1434,1438 ----
  497.   #else /* No DEATH_SUPPORT */
  498.   
  499. !     if ((strcmp (rcs, tmp) == 0 || CVS_RENAME (rcs, tmp) != -1) ||
  500.           (!isreadable (rcs) && isreadable (tmp)))
  501.        {
  502. ***************
  503. *** 1589,1593 ****
  504.           
  505.           if (strcmp (oldfile, rcs) == 0
  506. !         || rename (oldfile, rcs) != 0
  507.           || isreadable (oldfile)
  508.           || !isreadable (rcs))
  509. --- 1589,1593 ----
  510.           
  511.           if (strcmp (oldfile, rcs) == 0
  512. !         || CVS_RENAME (oldfile, rcs) != 0
  513.           || isreadable (oldfile)
  514.           || !isreadable (rcs))
  515. ***************
  516. *** 1872,1876 ****
  517.       struct stat sb;
  518.   
  519. !     if (stat (user, &sb) != -1)
  520.       (void) chmod (rcs, (int) sb.st_mode & ~0222);
  521.   }
  522. --- 1872,1876 ----
  523.       struct stat sb;
  524.   
  525. !     if (CVS_STAT (user, &sb) != -1)
  526.       (void) chmod (rcs, (int) sb.st_mode & ~0222);
  527.   }
  528. diff -r -C 2 -P base/cvs-1.6.5/src/create_adm.c cvs-1.6.5/src/create_adm.c
  529. *** base/cvs-1.6.5/src/create_adm.c    Fri Sep  8 07:20:21 1995
  530. --- cvs-1.6.5/src/create_adm.c    Tue Jan  9 05:33:07 1996
  531. ***************
  532. *** 66,70 ****
  533.       else
  534.       (void) strcpy (tmp, CVSADM_REP);
  535. !     fout = fopen (tmp, "w+");
  536.       if (fout == NULL)
  537.       {
  538. --- 66,70 ----
  539.       else
  540.       (void) strcpy (tmp, CVSADM_REP);
  541. !     fout = CVS_FOPEN (tmp, "w+");
  542.       if (fout == NULL)
  543.       {
  544. ***************
  545. *** 112,116 ****
  546.       else
  547.       (void) strcpy (tmp, CVSADM_ENT);
  548. !     fout = fopen (tmp, "w+");
  549.       if (fout == NULL)
  550.       {
  551. --- 112,116 ----
  552.       else
  553.       (void) strcpy (tmp, CVSADM_ENT);
  554. !     fout = CVS_FOPEN (tmp, "w+");
  555.       if (fout == NULL)
  556.       {
  557. diff -r -C 2 -P base/cvs-1.6.5/src/cvs.h cvs-1.6.5/src/cvs.h
  558. *** base/cvs-1.6.5/src/cvs.h    Wed Jan  3 06:20:23 1996
  559. --- cvs-1.6.5/src/cvs.h    Tue Jan  9 05:33:06 1996
  560. ***************
  561. *** 231,236 ****
  562. --- 231,241 ----
  563.   #endif
  564.   
  565. + #ifndef FALSE
  566.   #define    FALSE        0
  567. + #endif
  568. + #ifndef TRUE
  569.   #define    TRUE        1
  570. + #endif
  571.   
  572.   /*
  573. diff -r -C 2 -P base/cvs-1.6.5/src/diff.c cvs-1.6.5/src/diff.c
  574. *** base/cvs-1.6.5/src/diff.c    Thu Jan  4 06:20:27 1996
  575. --- cvs-1.6.5/src/diff.c    Tue Jan  9 05:33:07 1996
  576. ***************
  577. *** 373,377 ****
  578.           if (run_exec (RUN_TTY, tmpnam (tmp), RUN_TTY, RUN_REALLY) == -1)
  579.           {
  580. !         (void) unlink (tmp);
  581.           error (1, errno, "fork failed during checkout of %s",
  582.                  vers->srcfile->path);
  583. --- 373,377 ----
  584.           if (run_exec (RUN_TTY, tmpnam (tmp), RUN_TTY, RUN_REALLY) == -1)
  585.           {
  586. !         (void) CVS_UNLINK (tmp);
  587.           error (1, errno, "fork failed during checkout of %s",
  588.                  vers->srcfile->path);
  589. ***************
  590. *** 423,427 ****
  591.   
  592.       if (empty_file == DIFF_REMOVED)
  593. !     (void) unlink (tmp);
  594.   
  595.       (void) fflush (stdout);
  596. --- 423,427 ----
  597.   
  598.       if (empty_file == DIFF_REMOVED)
  599. !     (void) CVS_UNLINK (tmp);
  600.   
  601.       (void) fflush (stdout);
  602. ***************
  603. *** 611,620 ****
  604.           if (xcmp (file, tmp) == 0)
  605.           {
  606. !         (void) unlink (tmp);
  607.           return (1);
  608.           }
  609.           break;
  610.       case -1:            /* fork failed */
  611. !         (void) unlink (tmp);
  612.           error (1, errno, "fork failed during checkout of %s",
  613.              vers->srcfile->path);
  614. --- 611,620 ----
  615.           if (xcmp (file, tmp) == 0)
  616.           {
  617. !         (void) CVS_UNLINK (tmp);
  618.           return (1);
  619.           }
  620.           break;
  621.       case -1:            /* fork failed */
  622. !         (void) CVS_UNLINK (tmp);
  623.           error (1, errno, "fork failed during checkout of %s",
  624.              vers->srcfile->path);
  625. ***************
  626. *** 622,626 ****
  627.           break;
  628.       }
  629. !     (void) unlink (tmp);
  630.       return (0);
  631.   }
  632. --- 622,626 ----
  633.           break;
  634.       }
  635. !     (void) CVS_UNLINK (tmp);
  636.       return (0);
  637.   }
  638. diff -r -C 2 -P base/cvs-1.6.5/src/edit.c cvs-1.6.5/src/edit.c
  639. *** base/cvs-1.6.5/src/edit.c    Thu Jan  4 06:20:27 1996
  640. --- cvs-1.6.5/src/edit.c    Tue Jan  9 05:33:07 1996
  641. ***************
  642. *** 180,184 ****
  643.          is most sensible.  */
  644.   
  645. !     fp = fopen (CVSADM_NOTIFY, "r");
  646.       if (fp == NULL)
  647.       {
  648. --- 180,184 ----
  649.          is most sensible.  */
  650.   
  651. !     fp = CVS_FOPEN (CVSADM_NOTIFY, "r");
  652.       if (fp == NULL)
  653.       {
  654. ***************
  655. *** 225,229 ****
  656.       error (0, errno, "cannot close %s", CVSADM_NOTIFY);
  657.   
  658. !     if (unlink (CVSADM_NOTIFY) < 0)
  659.       error (0, errno, "cannot remove %s", CVSADM_NOTIFY);
  660.   
  661. --- 225,229 ----
  662.       error (0, errno, "cannot close %s", CVSADM_NOTIFY);
  663.   
  664. !     if (CVS_UNLINK (CVSADM_NOTIFY) < 0)
  665.       error (0, errno, "cannot remove %s", CVSADM_NOTIFY);
  666.   
  667. ***************
  668. *** 810,814 ****
  669.          is most sensible.  */
  670.   
  671. !     fp = fopen (CVSADM_NOTIFY, "r");
  672.       if (fp == NULL)
  673.       {
  674. --- 810,814 ----
  675.          is most sensible.  */
  676.   
  677. !     fp = CVS_FOPEN (CVSADM_NOTIFY, "r");
  678.       if (fp == NULL)
  679.       {
  680. diff -r -C 2 -P base/cvs-1.6.5/src/entries.c cvs-1.6.5/src/entries.c
  681. *** base/cvs-1.6.5/src/entries.c    Thu Jan  4 06:20:28 1996
  682. --- cvs-1.6.5/src/entries.c    Tue Jan  9 05:33:07 1996
  683. ***************
  684. *** 280,284 ****
  685.       {
  686.           struct stat sb;
  687. !         if (strlen (ts) > 30 && stat (user, &sb) == 0)
  688.           {
  689.           char *c = ctime (&sb.st_mtime);
  690. --- 280,284 ----
  691.       {
  692.           struct stat sb;
  693. !         if (strlen (ts) > 30 && CVS_STAT (user, &sb) == 0)
  694.           {
  695.           char *c = ctime (&sb.st_mtime);
  696. ***************
  697. *** 373,377 ****
  698.       }
  699.   
  700. !     fpin = fopen (CVSADM_ENT, "r");
  701.       if (fpin == NULL)
  702.       error (0, errno, "cannot open %s for reading", CVSADM_ENT);
  703. --- 373,377 ----
  704.       }
  705.   
  706. !     fpin = CVS_FOPEN (CVSADM_ENT, "r");
  707.       if (fpin == NULL)
  708.       error (0, errno, "cannot open %s for reading", CVSADM_ENT);
  709. ***************
  710. *** 384,390 ****
  711.   
  712.       fclose (fpin);
  713.       }
  714.   
  715. !     fpin = fopen (CVSADM_ENTLOG, "r");
  716.       if (fpin != NULL) 
  717.       {
  718. --- 384,391 ----
  719.   
  720.       fclose (fpin);
  721. +     fpin = NULL;
  722.       }
  723.   
  724. !     fpin = CVS_FOPEN (CVSADM_ENTLOG, "r");
  725.       if (fpin != NULL) 
  726.       {
  727. ***************
  728. *** 395,398 ****
  729. --- 396,400 ----
  730.       do_rewrite = 1;
  731.       fclose (fpin);
  732. +     fpin = NULL;
  733.       }
  734.   
  735. ***************
  736. *** 528,532 ****
  737.       if (datep)
  738.       *datep = (char *) NULL;
  739. !     fp = fopen (CVSADM_TAG, "r");
  740.       if (fp)
  741.       {
  742. --- 530,534 ----
  743.       if (datep)
  744.       *datep = (char *) NULL;
  745. !     fp = CVS_FOPEN (CVSADM_TAG, "r");
  746.       if (fp)
  747.       {
  748. diff -r -C 2 -P base/cvs-1.6.5/src/error.c cvs-1.6.5/src/error.c
  749. *** base/cvs-1.6.5/src/error.c    Sat Dec 16 06:20:29 1995
  750. --- cvs-1.6.5/src/error.c    Tue Jan  9 05:33:07 1996
  751. ***************
  752. *** 67,71 ****
  753. --- 67,73 ----
  754.   #endif /* STDC_HEADERS */
  755.   
  756. + #ifndef macintosh
  757.   extern char *strerror ();
  758. + #endif
  759.   
  760.   typedef void (*fn_returning_void) PROTO((void));
  761. diff -r -C 2 -P base/cvs-1.6.5/src/fileattr.c cvs-1.6.5/src/fileattr.c
  762. *** base/cvs-1.6.5/src/fileattr.c    Fri Dec 22 06:20:27 1995
  763. --- cvs-1.6.5/src/fileattr.c    Tue Jan  9 05:33:07 1996
  764. ***************
  765. *** 79,83 ****
  766.   
  767.       attr_read_attempted = 1;
  768. !     fp = fopen (fname, "r");
  769.       if (fp == NULL)
  770.       {
  771. --- 79,83 ----
  772.   
  773.       attr_read_attempted = 1;
  774. !     fp = CVS_FOPEN (fname, "r");
  775.       if (fp == NULL)
  776.       {
  777. ***************
  778. *** 440,444 ****
  779.   
  780.       omask = umask (cvsumask);
  781. !     fp = fopen (fname, "w");
  782.       if (fp == NULL)
  783.       {
  784. --- 440,444 ----
  785.   
  786.       omask = umask (cvsumask);
  787. !     fp = CVS_FOPEN (fname, "w");
  788.       if (fp == NULL)
  789.       {
  790. ***************
  791. *** 465,469 ****
  792.           free (repname);
  793.   
  794. !         fp = fopen (fname, "w");
  795.       }
  796.       if (fp == NULL)
  797. --- 465,469 ----
  798.           free (repname);
  799.   
  800. !         fp = CVS_FOPEN (fname, "w");
  801.       }
  802.       if (fp == NULL)
  803. diff -r -C 2 -P base/cvs-1.6.5/src/filesubr.c cvs-1.6.5/src/filesubr.c
  804. *** base/cvs-1.6.5/src/filesubr.c    Tue Jan  2 06:20:27 1996
  805. --- cvs-1.6.5/src/filesubr.c    Tue Jan  9 05:48:57 1996
  806. ***************
  807. *** 61,69 ****
  808.       return;
  809.   
  810. !     if ((fdin = open (from, O_RDONLY)) < 0)
  811.       error (1, errno, "cannot open %s for copying", from);
  812.       if (fstat (fdin, &sb) < 0)
  813.       error (1, errno, "cannot fstat %s", from);
  814. !     if ((fdout = creat (to, (int) sb.st_mode & 07777)) < 0)
  815.       error (1, errno, "cannot create %s for copying", to);
  816.       if (sb.st_size > 0)
  817. --- 61,69 ----
  818.       return;
  819.   
  820. !     if ((fdin = CVS_OPEN (from, O_RDONLY)) < 0)
  821.       error (1, errno, "cannot open %s for copying", from);
  822.       if (fstat (fdin, &sb) < 0)
  823.       error (1, errno, "cannot fstat %s", from);
  824. !     if ((fdout = CVS_CREAT (to, (int) sb.st_mode & 07777)) < 0)
  825.       error (1, errno, "cannot create %s for copying", to);
  826.       if (sb.st_size > 0)
  827. ***************
  828. *** 122,126 ****
  829.       struct stat sb;
  830.   
  831. !     if (stat (file, &sb) < 0)
  832.       return (0);
  833.       return (S_ISDIR (sb.st_mode));
  834. --- 122,126 ----
  835.       struct stat sb;
  836.   
  837. !     if (CVS_STAT (file, &sb) < 0)
  838.       return (0);
  839.       return (S_ISDIR (sb.st_mode));
  840. ***************
  841. *** 192,196 ****
  842.       int uid;
  843.       
  844. !     if (stat(file, &sb) == -1)
  845.       return 0;
  846.       if (mode == F_OK)
  847. --- 192,196 ----
  848.       int uid;
  849.       
  850. !     if (CVS_STAT(file, &sb) == -1)
  851.       return 0;
  852.       if (mode == F_OK)
  853. ***************
  854. *** 232,236 ****
  855.       return (sb.st_mode & omask) == omask;
  856.   #else
  857. !     return access(file, mode) == 0;
  858.   #endif
  859.   }
  860. --- 232,236 ----
  861.       return (sb.st_mode & omask) == omask;
  862.   #else
  863. !     return CVS_ACCESS (file, mode) == 0;
  864.   #endif
  865.   }
  866. ***************
  867. *** 246,250 ****
  868.       FILE *fp;
  869.   
  870. !     if ((fp = fopen (name, mode)) == NULL)
  871.       error (1, errno, "cannot open %s", name);
  872.       return (fp);
  873. --- 246,250 ----
  874.       FILE *fp;
  875.   
  876. !     if ((fp = CVS_FOPEN (name, mode)) == NULL)
  877.       error (1, errno, "cannot open %s", name);
  878.       return (fp);
  879. ***************
  880. *** 260,266 ****
  881.       struct stat sb;
  882.   
  883. !     if (stat (name, &sb) == 0 && (!S_ISDIR (sb.st_mode)))
  884.           error (0, 0, "%s already exists but is not a directory", name);
  885. !     if (!noexec && mkdir (name, 0777) < 0)
  886.       error (1, errno, "cannot make directory %s", name);
  887.   }
  888. --- 260,266 ----
  889.       struct stat sb;
  890.   
  891. !     if (CVS_STAT (name, &sb) == 0 && (!S_ISDIR (sb.st_mode)))
  892.           error (0, 0, "%s already exists but is not a directory", name);
  893. !     if (!noexec && CVS_MKDIR (name, 0777) < 0)
  894.       error (1, errno, "cannot make directory %s", name);
  895.   }
  896. ***************
  897. *** 279,283 ****
  898.       return;
  899.   
  900. !     if (mkdir (name, 0777) == 0 || errno == EEXIST)
  901.       return;
  902.       if (! existence_error (errno))
  903. --- 279,283 ----
  904.       return;
  905.   
  906. !     if (CVS_MKDIR (name, 0777) == 0 || errno == EEXIST)
  907.       return;
  908.       if (! existence_error (errno))
  909. ***************
  910. *** 293,297 ****
  911.       if (*cp == '\0')
  912.       return;
  913. !     (void) mkdir (name, 0777);
  914.   }
  915.   
  916. --- 293,297 ----
  917.       if (*cp == '\0')
  918.       return;
  919. !     (void) CVS_MKDIR (name, 0777);
  920.   }
  921.   
  922. ***************
  923. *** 308,312 ****
  924.       mode_t mode, oumask;
  925.   
  926. !     if (stat (fname, &sb) < 0)
  927.       {
  928.       if (!noexec)
  929. --- 308,312 ----
  930.       mode_t mode, oumask;
  931.   
  932. !     if (CVS_STAT (fname, &sb) < 0)
  933.       {
  934.       if (!noexec)
  935. ***************
  936. *** 360,364 ****
  937.       return;
  938.   
  939. !     if (rename (from, to) < 0)
  940.       error (1, errno, "cannot rename file %s to %s", from, to);
  941.   }
  942. --- 360,364 ----
  943.       return;
  944.   
  945. !     if (CVS_RENAME (from, to) < 0)
  946.       error (1, errno, "cannot rename file %s to %s", from, to);
  947.   }
  948. ***************
  949. *** 384,388 ****
  950. --- 384,392 ----
  951.       return (0);
  952.   
  953. + #ifdef macintosh
  954. +     return (symlink (from, to));
  955. + #else
  956.       return (link (from, to));
  957. + #endif
  958.   }
  959.   
  960. ***************
  961. *** 404,408 ****
  962.       return (0);
  963.   
  964. !     return (unlink (f));
  965.   }
  966.   
  967. --- 408,412 ----
  968.       return (0);
  969.   
  970. !     return (CVS_UNLINK (f));
  971.   }
  972.   
  973. ***************
  974. *** 426,430 ****
  975.       return (0);
  976.   
  977. !     if (unlink (f) != 0)
  978.       {
  979.       /* under NEXTSTEP errno is set to return EPERM if
  980. --- 430,434 ----
  981.       return (0);
  982.   
  983. !     if (CVS_UNLINK (f) != 0)
  984.       {
  985.       /* under NEXTSTEP errno is set to return EPERM if
  986. ***************
  987. *** 461,465 ****
  988.       if ( rmdir (path) != 0 && errno == ENOTEMPTY )
  989.       {
  990. !     if ((dirp = opendir (path)) == NULL)
  991.           /* If unable to open the directory return
  992.            * an error
  993. --- 465,469 ----
  994.       if ( rmdir (path) != 0 && errno == ENOTEMPTY )
  995.       {
  996. !     if ((dirp = CVS_OPENDIR (path)) == NULL)
  997.           /* If unable to open the directory return
  998.            * an error
  999. ***************
  1000. *** 475,479 ****
  1001.           sprintf (buf, "%s/%s", path, dp->d_name);
  1002.   
  1003. !         if (unlink (buf) != 0 )
  1004.           {
  1005.           if (errno == EISDIR || errno == EPERM)
  1006. --- 479,483 ----
  1007.           sprintf (buf, "%s/%s", path, dp->d_name);
  1008.   
  1009. !         if (CVS_UNLINK (buf) != 0 )
  1010.           {
  1011.           if (errno == EISDIR || errno == EPERM)
  1012. ***************
  1013. *** 550,556 ****
  1014.       int ret;
  1015.   
  1016. !     if ((fd1 = open (file1, O_RDONLY)) < 0)
  1017.       error (1, errno, "cannot open file %s for comparing", file1);
  1018. !     if ((fd2 = open (file2, O_RDONLY)) < 0)
  1019.       error (1, errno, "cannot open file %s for comparing", file2);
  1020.       if (fstat (fd1, &sb1) < 0)
  1021. --- 554,560 ----
  1022.       int ret;
  1023.   
  1024. !     if ((fd1 = CVS_OPEN (file1, O_RDONLY)) < 0)
  1025.       error (1, errno, "cannot open file %s for comparing", file1);
  1026. !     if ((fd2 = CVS_OPEN (file2, O_RDONLY)) < 0)
  1027.       error (1, errno, "cannot open file %s for comparing", file2);
  1028.       if (fstat (fd1, &sb1) < 0)
  1029. diff -r -C 2 -P base/cvs-1.6.5/src/find_names.c cvs-1.6.5/src/find_names.c
  1030. *** base/cvs-1.6.5/src/find_names.c    Sat Dec 16 06:20:30 1995
  1031. --- cvs-1.6.5/src/find_names.c    Tue Jan  9 05:33:07 1996
  1032. ***************
  1033. *** 129,133 ****
  1034.       /* look only for CVS controlled sub-directories */
  1035.       if (find_dirs (".", dirlist, 1) != 0)
  1036. !         error (1, errno, "cannot open current directory");
  1037.       }
  1038.   
  1039. --- 129,133 ----
  1040.       /* look only for CVS controlled sub-directories */
  1041.       if (find_dirs (".", dirlist, 1) != 0)
  1042. !         error (1, errno, "cannot open current directory\n");
  1043.       }
  1044.   
  1045. ***************
  1046. *** 171,175 ****
  1047.   
  1048.       /* set up to read the dir */
  1049. !     if ((dirp = opendir (dir)) == NULL)
  1050.       return (1);
  1051.   
  1052. --- 171,175 ----
  1053.   
  1054.       /* set up to read the dir */
  1055. !     if ((dirp = CVS_OPENDIR (dir)) == NULL)
  1056.       return (1);
  1057.   
  1058. ***************
  1059. *** 211,217 ****
  1060.   
  1061.       /* set up to read the dir */
  1062. !     if ((dirp = opendir (dir)) == NULL)
  1063.       return (1);
  1064.       /* read the dir, grabbing sub-dirs */
  1065.       while ((dp = readdir (dirp)) != NULL)
  1066. --- 211,216 ----
  1067.   
  1068.       /* set up to read the dir */
  1069. !     if ((dirp = CVS_OPENDIR (dir)) == NULL)
  1070.       return (1);
  1071.       /* read the dir, grabbing sub-dirs */
  1072.       while ((dp = readdir (dirp)) != NULL)
  1073. diff -r -C 2 -P base/cvs-1.6.5/src/history.c cvs-1.6.5/src/history.c
  1074. *** base/cvs-1.6.5/src/history.c    Thu Jan  4 06:20:28 1996
  1075. --- cvs-1.6.5/src/history.c    Tue Jan  9 05:33:07 1996
  1076. ***************
  1077. *** 702,706 ****
  1078.       if (noexec)
  1079.       return;
  1080. !     if ((fd = open (fname, O_WRONLY | O_APPEND | O_CREAT, 0666)) < 0)
  1081.       error (1, errno, "cannot open history file: %s", fname);
  1082.   
  1083. --- 702,706 ----
  1084.       if (noexec)
  1085.       return;
  1086. !     if ((fd = CVS_OPEN (fname, O_WRONLY | O_APPEND | O_CREAT, 0666)) < 0)
  1087.       error (1, errno, "cannot open history file: %s", fname);
  1088.   
  1089. ***************
  1090. *** 729,737 ****
  1091.           if (!getwd (workdir))
  1092.               error (1, errno, "can't getwd in history");
  1093. !         if (chdir (pw->pw_dir) < 0)
  1094.               error (1, errno, "can't chdir(%s)", pw->pw_dir);
  1095.           if (!getwd (homedir))
  1096.               error (1, errno, "can't getwd in %s", pw->pw_dir);
  1097. !         (void) chdir (workdir);
  1098.   
  1099.           i = strlen (homedir);
  1100. --- 729,737 ----
  1101.           if (!getwd (workdir))
  1102.               error (1, errno, "can't getwd in history");
  1103. !         if (CVS_CHDIR (pw->pw_dir) < 0)
  1104.               error (1, errno, "can't chdir(%s)", pw->pw_dir);
  1105.           if (!getwd (homedir))
  1106.               error (1, errno, "can't getwd in %s", pw->pw_dir);
  1107. !         (void) CVS_CHDIR (workdir);
  1108.   
  1109.           i = strlen (homedir);
  1110. ***************
  1111. *** 1001,1005 ****
  1112.       struct stat st_buf;
  1113.   
  1114. !     if ((fd = open (fname, O_RDONLY)) < 0)
  1115.       error (1, errno, "cannot open history file: %s", fname);
  1116.   
  1117. --- 1001,1005 ----
  1118.       struct stat st_buf;
  1119.   
  1120. !     if ((fd = CVS_OPEN (fname, O_RDONLY)) < 0)
  1121.       error (1, errno, "cannot open history file: %s", fname);
  1122.   
  1123. diff -r -C 2 -P base/cvs-1.6.5/src/ignore.c cvs-1.6.5/src/ignore.c
  1124. *** base/cvs-1.6.5/src/ignore.c    Thu Jan  4 06:20:29 1996
  1125. --- cvs-1.6.5/src/ignore.c    Tue Jan  9 05:33:07 1996
  1126. ***************
  1127. *** 132,136 ****
  1128.   
  1129.       /* load the file */
  1130. !     fp = fopen (file, "r");
  1131.       if (fp == NULL)
  1132.       {
  1133. --- 132,136 ----
  1134.   
  1135.       /* load the file */
  1136. !     fp = CVS_FOPEN (file, "r");
  1137.       if (fp == NULL)
  1138.       {
  1139. ***************
  1140. *** 317,321 ****
  1141.       xdir = update_dir;
  1142.   
  1143. !     dirp = opendir (".");
  1144.       if (dirp == NULL)
  1145.       return;
  1146. --- 317,321 ----
  1147.       xdir = update_dir;
  1148.   
  1149. !     dirp = CVS_OPENDIR (".");
  1150.       if (dirp == NULL)
  1151.       return;
  1152. diff -r -C 2 -P base/cvs-1.6.5/src/import.c cvs-1.6.5/src/import.c
  1153. *** base/cvs-1.6.5/src/import.c    Thu Jan  4 06:20:29 1996
  1154. --- cvs-1.6.5/src/import.c    Tue Jan  9 05:33:08 1996
  1155. ***************
  1156. *** 250,256 ****
  1157.   
  1158.       /* Create the logfile that will be logged upon completion */
  1159. !     if ((logfp = fopen (tmpnam (tmpfile), "w+")) == NULL)
  1160.       error (1, errno, "cannot create temporary file `%s'", tmpfile);
  1161. !     (void) unlink (tmpfile);        /* to be sure it goes away */
  1162.       (void) fprintf (logfp, "\nVendor Tag:\t%s\n", argv[1]);
  1163.       (void) fprintf (logfp, "Release Tags:\t");
  1164. --- 250,256 ----
  1165.   
  1166.       /* Create the logfile that will be logged upon completion */
  1167. !     if ((logfp = CVS_FOPEN (tmpnam (tmpfile), "w+")) == NULL)
  1168.       error (1, errno, "cannot create temporary file `%s'", tmpfile);
  1169. !     (void) CVS_UNLINK (tmpfile);        /* to be sure it goes away */
  1170.       (void) fprintf (logfp, "\nVendor Tag:\t%s\n", argv[1]);
  1171.       (void) fprintf (logfp, "Release Tags:\t");
  1172. ***************
  1173. *** 302,306 ****
  1174.       /* Make sure the temporary file goes away, even on systems that don't let
  1175.          you delete a file that's in use.  */
  1176. !     unlink (tmpfile);
  1177.   
  1178.       if (message)
  1179. --- 302,306 ----
  1180.       /* Make sure the temporary file goes away, even on systems that don't let
  1181.          you delete a file that's in use.  */
  1182. !     CVS_UNLINK (tmpfile);
  1183.   
  1184.       if (message)
  1185. ***************
  1186. *** 329,333 ****
  1187.       wrap_add_file (CVSDOTWRAPPER, 1);
  1188.   
  1189. !     if ((dirp = opendir (".")) == NULL)
  1190.       {
  1191.       err++;
  1192. --- 329,333 ----
  1193.       wrap_add_file (CVSDOTWRAPPER, 1);
  1194.   
  1195. !     if ((dirp = CVS_OPENDIR (".")) == NULL)
  1196.       {
  1197.       err++;
  1198. ***************
  1199. *** 867,871 ****
  1200.       tocvsPath = wrap_tocvs_process_file (user);
  1201.       userfile = (tocvsPath == NULL ? user : tocvsPath);
  1202. !     fpuser = fopen (userfile, "r");
  1203.       if (fpuser == NULL) {
  1204.       /* not fatal, continue import */
  1205. --- 867,871 ----
  1206.       tocvsPath = wrap_tocvs_process_file (user);
  1207.       userfile = (tocvsPath == NULL ? user : tocvsPath);
  1208. !     fpuser = CVS_FOPEN (userfile, "r");
  1209.       if (fpuser == NULL) {
  1210.       /* not fatal, continue import */
  1211. ***************
  1212. *** 874,878 ****
  1213.       goto read_error;
  1214.       }
  1215. !     fprcs = fopen (rcs, "w+");
  1216.       if (fprcs == NULL) {
  1217.       ierrno = errno;
  1218. --- 874,878 ----
  1219.       goto read_error;
  1220.       }
  1221. !     fprcs = CVS_FOPEN (rcs, "w+");
  1222.       if (fprcs == NULL) {
  1223.       ierrno = errno;
  1224. ***************
  1225. *** 1036,1040 ****
  1226.       if (ierrno == ENOSPC)
  1227.       {
  1228. !     (void) unlink (rcs);
  1229.       fperror (logfp, 0, 0, "ERROR: out of space - aborting");
  1230.       error (1, 0, "ERROR: out of space - aborting");
  1231. --- 1036,1040 ----
  1232.       if (ierrno == ENOSPC)
  1233.       {
  1234. !     (void) CVS_UNLINK (rcs);
  1235.       fperror (logfp, 0, 0, "ERROR: out of space - aborting");
  1236.       error (1, 0, "ERROR: out of space - aborting");
  1237. ***************
  1238. *** 1149,1153 ****
  1239.   #endif
  1240.   
  1241. !     if (chdir (dir) < 0)
  1242.       {
  1243.       ierrno = errno;
  1244. --- 1149,1153 ----
  1245.   #endif
  1246.   
  1247. !     if (CVS_CHDIR (dir) < 0)
  1248.       {
  1249.       ierrno = errno;
  1250. diff -r -C 2 -P base/cvs-1.6.5/src/lock.c cvs-1.6.5/src/lock.c
  1251. *** base/cvs-1.6.5/src/lock.c    Mon Dec 18 06:20:26 1995
  1252. --- cvs-1.6.5/src/lock.c    Tue Jan  9 05:33:08 1996
  1253. ***************
  1254. *** 84,88 ****
  1255.       {
  1256.       (void) sprintf (tmp, "%s/%s", repository, readlock);
  1257. !     if (unlink (tmp) < 0 && ! existence_error (errno))
  1258.           error (0, errno, "failed to remove lock %s", tmp);
  1259.       }
  1260. --- 84,88 ----
  1261.       {
  1262.       (void) sprintf (tmp, "%s/%s", repository, readlock);
  1263. !     if (CVS_UNLINK (tmp) < 0 && ! existence_error (errno))
  1264.           error (0, errno, "failed to remove lock %s", tmp);
  1265.       }
  1266. ***************
  1267. *** 91,95 ****
  1268.       {
  1269.       (void) sprintf (tmp, "%s/%s", repository, writelock);
  1270. !     if (unlink (tmp) < 0 && ! existence_error (errno))
  1271.           error (0, errno, "failed to remove lock %s", tmp);
  1272.       }
  1273. --- 91,95 ----
  1274.       {
  1275.       (void) sprintf (tmp, "%s/%s", repository, writelock);
  1276. !     if (CVS_UNLINK (tmp) < 0 && ! existence_error (errno))
  1277.           error (0, errno, "failed to remove lock %s", tmp);
  1278.       }
  1279. ***************
  1280. *** 133,137 ****
  1281.     /* Check if the uidlock is in the lock directory */
  1282.     sprintf(uidlock, "%s/uidlock%d", lockdir, geteuid() );
  1283. !   if( stat(uidlock, &sb) != -1)
  1284.       return 1;   /* The file exists, therefore we own the lock */
  1285.     else
  1286. --- 133,137 ----
  1287.     /* Check if the uidlock is in the lock directory */
  1288.     sprintf(uidlock, "%s/uidlock%d", lockdir, geteuid() );
  1289. !   if( CVS_STAT (uidlock, &sb) != -1)
  1290.       return 1;   /* The file exists, therefore we own the lock */
  1291.     else
  1292. ***************
  1293. *** 140,144 ****
  1294.            */
  1295.   #else
  1296. !   if (stat (lockdir, &sb) != -1 && sb.st_uid == geteuid ())
  1297.       return 1;
  1298.     else
  1299. --- 140,144 ----
  1300.            */
  1301.   #else
  1302. !   if (CVS_STAT (lockdir, &sb) != -1 && sb.st_uid == geteuid ())
  1303.       return 1;
  1304.     else
  1305. ***************
  1306. *** 190,203 ****
  1307.   #endif
  1308.       getpid());
  1309. !     if ((fp = fopen (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1310.       {
  1311.       error (0, errno, "cannot create read lock in repository `%s'",
  1312.              xrepository);
  1313.       readlock[0] = '\0';
  1314. !     if (unlink (tmp) < 0 && ! existence_error (errno))
  1315.           error (0, errno, "failed to remove lock %s", tmp);
  1316.       return (1);
  1317.       }
  1318. !     if (unlink (tmp) < 0)
  1319.       error (0, errno, "failed to remove lock %s", tmp);
  1320.   #endif
  1321. --- 190,203 ----
  1322.   #endif
  1323.       getpid());
  1324. !     if ((fp = CVS_FOPEN (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1325.       {
  1326.       error (0, errno, "cannot create read lock in repository `%s'",
  1327.              xrepository);
  1328.       readlock[0] = '\0';
  1329. !     if (CVS_UNLINK (tmp) < 0 && ! existence_error (errno))
  1330.           error (0, errno, "failed to remove lock %s", tmp);
  1331.       return (1);
  1332.       }
  1333. !     if (CVS_UNLINK (tmp) < 0)
  1334.       error (0, errno, "failed to remove lock %s", tmp);
  1335.   #endif
  1336. ***************
  1337. *** 214,218 ****
  1338.       /* write a read-lock */
  1339.       (void) sprintf (tmp, "%s/%s", xrepository, readlock);
  1340. !     if ((fp = fopen (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1341.       {
  1342.       error (0, errno, "cannot create read lock in repository `%s'",
  1343. --- 214,218 ----
  1344.       /* write a read-lock */
  1345.       (void) sprintf (tmp, "%s/%s", xrepository, readlock);
  1346. !     if ((fp = CVS_FOPEN (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1347.       {
  1348.       error (0, errno, "cannot create read lock in repository `%s'",
  1349. ***************
  1350. *** 328,340 ****
  1351.   #endif
  1352.       getpid ());
  1353. !     if ((fp = fopen (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1354.       {
  1355.       error (0, errno, "cannot create write lock in repository `%s'",
  1356.              repository);
  1357. !     if (unlink (tmp) < 0 && ! existence_error (errno))
  1358.           error (0, errno, "failed to remove lock %s", tmp);
  1359.       return (L_ERROR);
  1360.       }
  1361. !     if (unlink (tmp) < 0)
  1362.       error (0, errno, "failed to remove lock %s", tmp);
  1363.   #endif
  1364. --- 328,340 ----
  1365.   #endif
  1366.       getpid ());
  1367. !     if ((fp = CVS_FOPEN (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1368.       {
  1369.       error (0, errno, "cannot create write lock in repository `%s'",
  1370.              repository);
  1371. !     if (CVS_UNLINK (tmp) < 0 && ! existence_error (errno))
  1372.           error (0, errno, "failed to remove lock %s", tmp);
  1373.       return (L_ERROR);
  1374.       }
  1375. !     if (CVS_UNLINK (tmp) < 0)
  1376.       error (0, errno, "failed to remove lock %s", tmp);
  1377.   #endif
  1378. ***************
  1379. *** 359,367 ****
  1380.       /* write the write-lock file */
  1381.       (void) sprintf (tmp, "%s/%s", repository, writelock);
  1382. !     if ((fp = fopen (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1383.       {
  1384.           int xerrno = errno;
  1385.   
  1386. !         if (unlink (tmp) < 0 && ! existence_error (errno))
  1387.           error (0, errno, "failed to remove lock %s", tmp);
  1388.   
  1389. --- 359,367 ----
  1390.       /* write the write-lock file */
  1391.       (void) sprintf (tmp, "%s/%s", repository, writelock);
  1392. !     if ((fp = CVS_FOPEN (tmp, "w+")) == NULL || fclose (fp) == EOF)
  1393.       {
  1394.           int xerrno = errno;
  1395.   
  1396. !         if (CVS_UNLINK (tmp) < 0 && ! existence_error (errno))
  1397.           error (0, errno, "failed to remove lock %s", tmp);
  1398.   
  1399. ***************
  1400. *** 402,406 ****
  1401.   #endif
  1402.   
  1403. !     if ((dirp = opendir (repository)) == NULL)
  1404.       error (1, 0, "cannot open directory %s", repository);
  1405.   
  1406. --- 402,406 ----
  1407.   #endif
  1408.   
  1409. !     if ((dirp = CVS_OPENDIR (repository)) == NULL)
  1410.       error (1, 0, "cannot open directory %s", repository);
  1411.   
  1412. ***************
  1413. *** 417,421 ****
  1414.           line = xmalloc (strlen (repository) + strlen (dp->d_name) + 5);
  1415.           (void) sprintf (line, "%s/%s", repository, dp->d_name);
  1416. !         if (stat (line, &sb) != -1)
  1417.           {
  1418.   #ifdef CVS_FUDGELOCKS
  1419. --- 417,421 ----
  1420.           line = xmalloc (strlen (repository) + strlen (dp->d_name) + 5);
  1421.           (void) sprintf (line, "%s/%s", repository, dp->d_name);
  1422. !         if (CVS_STAT (line, &sb) != -1)
  1423.           {
  1424.   #ifdef CVS_FUDGELOCKS
  1425. ***************
  1426. *** 425,429 ****
  1427.            * successful, re-open the directory and try again.
  1428.            */
  1429. !         if (now >= (sb.st_ctime + CVSLCKAGE) && unlink (line) != -1)
  1430.           {
  1431.               (void) closedir (dirp);
  1432. --- 425,429 ----
  1433.            * successful, re-open the directory and try again.
  1434.            */
  1435. !         if (now >= (sb.st_ctime + CVSLCKAGE) && CVS_UNLINK (line) != -1)
  1436.           {
  1437.               (void) closedir (dirp);
  1438. ***************
  1439. *** 503,507 ****
  1440.   
  1441.           sprintf(uidlock, "%s/uidlock%d", masterlock, geteuid() );
  1442. !         if ((fp = fopen(uidlock, "w+")) == NULL)
  1443.           {
  1444.           /* We failed to create the uidlock,
  1445. --- 503,507 ----
  1446.   
  1447.           sprintf(uidlock, "%s/uidlock%d", masterlock, geteuid() );
  1448. !         if ((fp = CVS_FOPEN (uidlock, "w+")) == NULL)
  1449.           {
  1450.           /* We failed to create the uidlock,
  1451. ***************
  1452. *** 539,543 ****
  1453.        * someone probably just removed it (thus releasing the lock)
  1454.        */
  1455. !     if (stat (masterlock, &sb) < 0)
  1456.       {
  1457.           if (existence_error (errno))
  1458. --- 539,543 ----
  1459.        * someone probably just removed it (thus releasing the lock)
  1460.        */
  1461. !     if (CVS_STAT (masterlock, &sb) < 0)
  1462.       {
  1463.           if (existence_error (errno))
  1464. diff -r -C 2 -P base/cvs-1.6.5/src/login.c cvs-1.6.5/src/login.c
  1465. *** base/cvs-1.6.5/src/login.c    Sun Dec 24 06:20:24 1995
  1466. --- cvs-1.6.5/src/login.c    Tue Jan  9 05:33:08 1996
  1467. ***************
  1468. *** 192,196 ****
  1469.        inefficient, but we're not talking about a gig of data here. */
  1470.   
  1471. !   fp = fopen (passfile, "r");
  1472.     if (fp != NULL)
  1473.       {
  1474. --- 192,196 ----
  1475.        inefficient, but we're not talking about a gig of data here. */
  1476.   
  1477. !   fp = CVS_FOPEN (passfile, "r");
  1478.     if (fp != NULL)
  1479.       {
  1480. ***************
  1481. *** 232,236 ****
  1482.   
  1483.             tmp_name = tmpnam (NULL);
  1484. !           if ((tmp_fp = fopen (tmp_name, "w")) == NULL)
  1485.               {
  1486.                 error (1, errno, "unable to open temp file %s", tmp_name);
  1487. --- 232,236 ----
  1488.   
  1489.             tmp_name = tmpnam (NULL);
  1490. !           if ((tmp_fp = CVS_FOPEN (tmp_name, "w")) == NULL)
  1491.               {
  1492.                 error (1, errno, "unable to open temp file %s", tmp_name);
  1493. ***************
  1494. *** 239,243 ****
  1495.             chmod (tmp_name, 0600);
  1496.   
  1497. !           fp = fopen (passfile, "r");
  1498.             if (fp == NULL)
  1499.               {
  1500. --- 239,243 ----
  1501.             chmod (tmp_name, 0600);
  1502.   
  1503. !           fp = CVS_FOPEN (passfile, "r");
  1504.             if (fp == NULL)
  1505.               {
  1506. ***************
  1507. *** 268,272 ****
  1508.     else
  1509.       {
  1510. !       if ((fp = fopen (passfile, "a")) == NULL)
  1511.           {
  1512.             error (1, errno, "could not open %s", passfile);
  1513. --- 268,272 ----
  1514.     else
  1515.       {
  1516. !       if ((fp = CVS_FOPEN (passfile, "a")) == NULL)
  1517.           {
  1518.             error (1, errno, "could not open %s", passfile);
  1519. ***************
  1520. *** 327,331 ****
  1521.     /* Else get it from the file. */
  1522.     passfile = construct_cvspass_filename ();
  1523. !   fp = fopen (passfile, "r");
  1524.     if (fp == NULL)
  1525.       {
  1526. --- 327,331 ----
  1527.     /* Else get it from the file. */
  1528.     passfile = construct_cvspass_filename ();
  1529. !   fp = CVS_FOPEN (passfile, "r");
  1530.     if (fp == NULL)
  1531.       {
  1532. diff -r -C 2 -P base/cvs-1.6.5/src/logmsg.c cvs-1.6.5/src/logmsg.c
  1533. *** base/cvs-1.6.5/src/logmsg.c    Mon Dec 25 06:20:18 1995
  1534. --- cvs-1.6.5/src/logmsg.c    Tue Jan  9 05:33:08 1996
  1535. ***************
  1536. *** 145,149 ****
  1537.       (void) tmpnam (fname);
  1538.     again:
  1539. !     if ((fp = fopen (fname, "w+")) == NULL)
  1540.       error (1, 0, "cannot create temporary file %s", fname);
  1541.   
  1542. --- 145,149 ----
  1543.       (void) tmpnam (fname);
  1544.     again:
  1545. !     if ((fp = CVS_FOPEN (fname, "w+")) == NULL)
  1546.       error (1, 0, "cannot create temporary file %s", fname);
  1547.   
  1548. ***************
  1549. *** 180,184 ****
  1550.       if (fclose (fp) == EOF)
  1551.           error (1, errno, "%s", fname);
  1552. !     if (stat (fname, &pre_stbuf) == -1)
  1553.       pre_stbuf.st_mtime = 0;
  1554.   
  1555. --- 180,184 ----
  1556.       if (fclose (fp) == EOF)
  1557.           error (1, errno, "%s", fname);
  1558. !     if (CVS_STAT (fname, &pre_stbuf) == -1)
  1559.       pre_stbuf.st_mtime = 0;
  1560.   
  1561. ***************
  1562. *** 205,209 ****
  1563.       free (*messagep);
  1564.   
  1565. !     if (stat (fname, &post_stbuf) != 0)
  1566.           error (1, errno, "cannot find size of temp file %s", fname);
  1567.   
  1568. --- 205,209 ----
  1569.       free (*messagep);
  1570.   
  1571. !     if (CVS_STAT (fname, &post_stbuf) != 0)
  1572.           error (1, errno, "cannot find size of temp file %s", fname);
  1573.   
  1574. ***************
  1575. *** 293,297 ****
  1576.       last_template = xstrdup (template);
  1577.   
  1578. !     if ((tfp = fopen (template, "r")) != NULL)
  1579.       {
  1580.       char *line = NULL;
  1581. --- 293,297 ----
  1582.       last_template = xstrdup (template);
  1583.   
  1584. !     if ((tfp = CVS_FOPEN (template, "r")) != NULL)
  1585.       {
  1586.       char *line = NULL;
  1587. diff -r -C 2 -P base/cvs-1.6.5/src/main.c cvs-1.6.5/src/main.c
  1588. *** base/cvs-1.6.5/src/main.c    Sat Dec 16 06:20:32 1995
  1589. --- cvs-1.6.5/src/main.c    Tue Jan  9 05:33:08 1996
  1590. ***************
  1591. *** 37,40 ****
  1592. --- 37,44 ----
  1593.   #include "patchlevel.h"
  1594.   
  1595. + #ifdef macintosh
  1596. + #include <sioux.h>
  1597. + #endif
  1598.   #if HAVE_KERBEROS
  1599.   #include <sys/socket.h>
  1600. ***************
  1601. *** 269,272 ****
  1602. --- 273,285 ----
  1603.           don't use it. */
  1604.       int option_index = 0;
  1605. + #ifdef macintosh
  1606. +     GUSIDefaultSetup();
  1607. +     argc = ccommand(&argv);
  1608. +     SIOUXSettings.showstatusline = TRUE;
  1609. +     SIOUXSettings.asktosaveonclose = FALSE;
  1610. + #endif
  1611.   
  1612.       error_set_cleanup (error_cleanup);
  1613. diff -r -C 2 -P base/cvs-1.6.5/src/modules.c cvs-1.6.5/src/modules.c
  1614. *** base/cvs-1.6.5/src/modules.c    Thu Jan  4 06:20:30 1996
  1615. --- cvs-1.6.5/src/modules.c    Tue Jan  9 05:33:08 1996
  1616. ***************
  1617. *** 338,342 ****
  1618.                instead of just at the bottom */
  1619.           make_directories (dir);
  1620. !         if (chdir (dir) < 0)
  1621.           {
  1622.           error (0, errno, "cannot chdir to %s", dir);
  1623. --- 338,342 ----
  1624.                instead of just at the bottom */
  1625.           make_directories (dir);
  1626. !         if (CVS_CHDIR (dir) < 0)
  1627.           {
  1628.           error (0, errno, "cannot chdir to %s", dir);
  1629. ***************
  1630. *** 643,647 ****
  1631.   static int s_count = 0;            /* Number of elements used */
  1632.   
  1633. ! static int Status;                /* Nonzero if the user is
  1634.                          interested in status
  1635.                          information as well as
  1636. --- 643,647 ----
  1637.   static int s_count = 0;            /* Number of elements used */
  1638.   
  1639. ! static int capsstatus;                /* Nonzero if the user is
  1640.                          interested in status
  1641.                          information as well as
  1642. ***************
  1643. *** 663,667 ****
  1644.       const struct sortrec *right = (const struct sortrec *) r;
  1645.   
  1646. !     if (Status)
  1647.       {
  1648.       /* If Sort by status field, compare them. */
  1649. --- 663,667 ----
  1650.       const struct sortrec *right = (const struct sortrec *) r;
  1651.   
  1652. !     if (capsstatus)
  1653.       {
  1654.       /* If Sort by status field, compare them. */
  1655. ***************
  1656. *** 682,686 ****
  1657.       struct sortrec *s_rec;
  1658.   
  1659. !     if (Status && *d == '-' && *(d + 1) == 'a')
  1660.       return;                /* We want "cvs co -s" and it is an alias! */
  1661.   
  1662. --- 682,686 ----
  1663.       struct sortrec *s_rec;
  1664.   
  1665. !     if (capsstatus && *d == '-' && *(d + 1) == 'a')
  1666.       return;                /* We want "cvs co -s" and it is an alias! */
  1667.   
  1668. ***************
  1669. *** 716,720 ****
  1670.   
  1671.       /* Look for the "-s statusvalue" text */
  1672. !     if (Status)
  1673.       {
  1674.       s_rec->status = def_status;
  1675. --- 716,720 ----
  1676.   
  1677.       /* Look for the "-s statusvalue" text */
  1678. !     if (capsstatus)
  1679.       {
  1680.       s_rec->status = def_status;
  1681. ***************
  1682. *** 779,788 ****
  1683.       struct winsize ws;
  1684.   
  1685. !     (void) ioctl (0, TIOCGWINSZ, &ws);
  1686.       cols = ws.ws_col;
  1687.   #endif
  1688.   #endif
  1689.   
  1690. !     Status = status;
  1691.   
  1692.       /* Read the whole modules file into allocated records */
  1693. --- 779,792 ----
  1694.       struct winsize ws;
  1695.   
  1696. ! #ifdef __MWERKS__
  1697. !     (void) ioctl (0, TIOCGWINSZ, (long *) &ws);
  1698. ! #else
  1699. !     (void) ioctl (0, TIOCGWINSZ, &ws);
  1700. ! #endif
  1701.       cols = ws.ws_col;
  1702.   #endif
  1703.   #endif
  1704.   
  1705. !     capsstatus = status;
  1706.   
  1707.       /* Read the whole modules file into allocated records */
  1708. diff -r -C 2 -P base/cvs-1.6.5/src/myndbm.c cvs-1.6.5/src/myndbm.c
  1709. *** base/cvs-1.6.5/src/myndbm.c    Wed Jan  3 06:20:24 1996
  1710. --- cvs-1.6.5/src/myndbm.c    Tue Jan  9 05:33:08 1996
  1711. ***************
  1712. *** 37,41 ****
  1713.       DBM *db;
  1714.   
  1715. !     fp = fopen (file, "r");
  1716.       if (fp == NULL && !(existence_error (errno) && (flags & O_CREAT)))
  1717.       return ((DBM *) 0);
  1718. --- 37,41 ----
  1719.       DBM *db;
  1720.   
  1721. !     fp = CVS_FOPEN (file, "r");
  1722.       if (fp == NULL && !(existence_error (errno) && (flags & O_CREAT)))
  1723.       return ((DBM *) 0);
  1724. ***************
  1725. *** 77,81 ****
  1726.       {
  1727.       FILE *fp;
  1728. !     fp = fopen (db->name, "w");
  1729.       if (fp == NULL)
  1730.           error (1, errno, "cannot write %s", db->name);
  1731. --- 77,81 ----
  1732.       {
  1733.       FILE *fp;
  1734. !     fp = CVS_FOPEN (db->name, "w");
  1735.       if (fp == NULL)
  1736.           error (1, errno, "cannot write %s", db->name);
  1737. diff -r -C 2 -P base/cvs-1.6.5/src/no_diff.c cvs-1.6.5/src/no_diff.c
  1738. *** base/cvs-1.6.5/src/no_diff.c    Fri Sep  8 07:20:28 1995
  1739. --- cvs-1.6.5/src/no_diff.c    Tue Jan  9 05:33:08 1996
  1740. ***************
  1741. *** 98,102 ****
  1742.            * has been set to 1.  */
  1743.           if (trace)
  1744. !         (void) fprintf (stderr, "%c-> unlink (%s)\n",
  1745.   #ifdef SERVER_SUPPORT
  1746.                   (server_active) ? 'S' : ' ',
  1747. --- 98,102 ----
  1748.            * has been set to 1.  */
  1749.           if (trace)
  1750. !         (void) fprintf (stderr, "%c-> CVS_UNLINK (%s)\n",
  1751.   #ifdef SERVER_SUPPORT
  1752.                   (server_active) ? 'S' : ' ',
  1753. ***************
  1754. *** 105,109 ****
  1755.   #endif
  1756.                   tocvsPath);
  1757. !         if (unlink (tocvsPath) < 0)
  1758.           error (0, errno, "could not remove %s", tocvsPath);
  1759.       }
  1760. --- 105,109 ----
  1761.   #endif
  1762.                   tocvsPath);
  1763. !         if (CVS_UNLINK (tocvsPath) < 0)
  1764.           error (0, errno, "could not remove %s", tocvsPath);
  1765.       }
  1766. ***************
  1767. *** 127,133 ****
  1768.               (server_active) ? 'S' : ' ', tmp);
  1769.   #else
  1770. !     (void) fprintf (stderr, "-> unlink (%s)\n", tmp);
  1771.   #endif
  1772. !     if (unlink (tmp) < 0)
  1773.       error (0, errno, "could not remove %s", tmp);
  1774.       free (options);
  1775. --- 127,133 ----
  1776.               (server_active) ? 'S' : ' ', tmp);
  1777.   #else
  1778. !     (void) fprintf (stderr, "-> CVS_UNLINK (%s)\n", tmp);
  1779.   #endif
  1780. !     if (CVS_UNLINK (tmp) < 0)
  1781.       error (0, errno, "could not remove %s", tmp);
  1782.       free (options);
  1783. diff -r -C 2 -P base/cvs-1.6.5/src/parseinfo.c cvs-1.6.5/src/parseinfo.c
  1784. *** base/cvs-1.6.5/src/parseinfo.c    Tue Oct 17 07:20:14 1995
  1785. --- cvs-1.6.5/src/parseinfo.c    Tue Jan  9 05:33:08 1996
  1786. ***************
  1787. *** 48,52 ****
  1788.       (void) sprintf (infopath, "%s/%s/%s", CVSroot,
  1789.               CVSROOTADM, infofile);
  1790. !     if ((fp_info = fopen (infopath, "r")) == NULL)
  1791.       return (0);            /* no file -> nothing special done */
  1792.   
  1793. --- 48,52 ----
  1794.       (void) sprintf (infopath, "%s/%s/%s", CVSroot,
  1795.               CVSROOTADM, infofile);
  1796. !     if ((fp_info = CVS_FOPEN (infopath, "r")) == NULL)
  1797.       return (0);            /* no file -> nothing special done */
  1798.   
  1799. diff -r -C 2 -P base/cvs-1.6.5/src/patch.c cvs-1.6.5/src/patch.c
  1800. *** base/cvs-1.6.5/src/patch.c    Thu Jan  4 06:20:30 1996
  1801. --- cvs-1.6.5/src/patch.c    Tue Jan  9 05:33:08 1996
  1802. ***************
  1803. *** 302,306 ****
  1804.   
  1805.       /* cd to the starting repository */
  1806. !     if (chdir (repository) < 0)
  1807.       {
  1808.       error (0, errno, "cannot chdir to %s", repository);
  1809. --- 302,306 ----
  1810.   
  1811.       /* cd to the starting repository */
  1812. !     if (CVS_CHDIR (repository) < 0)
  1813.       {
  1814.       error (0, errno, "cannot chdir to %s", repository);
  1815. ***************
  1816. *** 428,436 ****
  1817.       return (0);
  1818.       }
  1819. !     if ((fp1 = fopen (tmpnam (tmpfile1), "w+")) != NULL)
  1820.       (void) fclose (fp1);
  1821. !     if ((fp2 = fopen (tmpnam (tmpfile2), "w+")) != NULL)
  1822.       (void) fclose (fp2);
  1823. !     if ((fp3 = fopen (tmpnam (tmpfile3), "w+")) != NULL)
  1824.       (void) fclose (fp3);
  1825.       if (fp1 == NULL || fp2 == NULL || fp3 == NULL)
  1826. --- 428,436 ----
  1827.       return (0);
  1828.       }
  1829. !     if ((fp1 = CVS_FOPEN (tmpnam (tmpfile1), "w+")) != NULL)
  1830.       (void) fclose (fp1);
  1831. !     if ((fp2 = CVS_FOPEN (tmpnam (tmpfile2), "w+")) != NULL)
  1832.       (void) fclose (fp2);
  1833. !     if ((fp3 = CVS_FOPEN (tmpnam (tmpfile3), "w+")) != NULL)
  1834.       (void) fclose (fp3);
  1835.       if (fp1 == NULL || fp2 == NULL || fp3 == NULL)
  1836. diff -r -C 2 -P base/cvs-1.6.5/src/rcs.c cvs-1.6.5/src/rcs.c
  1837. *** base/cvs-1.6.5/src/rcs.c    Mon Dec  4 06:20:22 1995
  1838. --- cvs-1.6.5/src/rcs.c    Tue Jan  9 05:33:08 1996
  1839. ***************
  1840. *** 144,148 ****
  1841.   
  1842.       (void) sprintf (rcsfile, "%s/%s%s", repos, file, RCSEXT);
  1843. !     if ((fp = fopen (rcsfile, "r")) != NULL) 
  1844.       {
  1845.           rcs = RCS_parsercsfile_i(fp, rcsfile);
  1846. --- 144,148 ----
  1847.   
  1848.       (void) sprintf (rcsfile, "%s/%s%s", repos, file, RCSEXT);
  1849. !     if ((fp = CVS_FOPEN (rcsfile, "r")) != NULL) 
  1850.       {
  1851.           rcs = RCS_parsercsfile_i(fp, rcsfile);
  1852. ***************
  1853. *** 166,170 ****
  1854.   
  1855.       (void) sprintf (rcsfile, "%s/%s/%s%s", repos, CVSATTIC, file, RCSEXT);
  1856. !     if ((fp = fopen (rcsfile, "r")) != NULL) 
  1857.       {
  1858.           rcs = RCS_parsercsfile_i(fp, rcsfile);
  1859. --- 166,170 ----
  1860.   
  1861.       (void) sprintf (rcsfile, "%s/%s/%s%s", repos, CVSATTIC, file, RCSEXT);
  1862. !     if ((fp = CVS_FOPEN (rcsfile, "r")) != NULL) 
  1863.       {
  1864.           rcs = RCS_parsercsfile_i(fp, rcsfile);
  1865. ***************
  1866. *** 204,208 ****
  1867.   
  1868.       /* open the rcsfile */
  1869. !     if ((fp = fopen (rcsfile, "r")) == NULL)
  1870.       {
  1871.       error (0, errno, "Couldn't open rcs file `%s'", rcsfile);
  1872. --- 204,208 ----
  1873.   
  1874.       /* open the rcsfile */
  1875. !     if ((fp = CVS_FOPEN (rcsfile, "r")) == NULL)
  1876.       {
  1877.       error (0, errno, "Couldn't open rcs file `%s'", rcsfile);
  1878. ***************
  1879. *** 308,312 ****
  1880.   #endif
  1881.   
  1882. !     fp = fopen(rcsfile, "r");
  1883.       if (fp == NULL)
  1884.       error (1, 0, "unable to reopen `%s'", rcsfile);
  1885. --- 308,312 ----
  1886.   #endif
  1887.   
  1888. !     fp = CVS_FOPEN (rcsfile, "r");
  1889.       if (fp == NULL)
  1890.       error (1, 0, "unable to reopen `%s'", rcsfile);
  1891. diff -r -C 2 -P base/cvs-1.6.5/src/recurse.c cvs-1.6.5/src/recurse.c
  1892. *** base/cvs-1.6.5/src/recurse.c    Sat Dec 16 06:20:33 1995
  1893. --- cvs-1.6.5/src/recurse.c    Tue Jan  9 05:33:08 1996
  1894. ***************
  1895. *** 519,523 ****
  1896.   
  1897.       /* cd to the sub-directory */
  1898. !     if (chdir (dir) < 0)
  1899.           error (1, errno, "could not chdir to %s", dir);
  1900.   
  1901. --- 519,523 ----
  1902.   
  1903.       /* cd to the sub-directory */
  1904. !     if (CVS_CHDIR (dir) < 0)
  1905.           error (1, errno, "could not chdir to %s", dir);
  1906.   
  1907. ***************
  1908. *** 631,635 ****
  1909.           if (save_cwd (&cwd))
  1910.           exit (1);
  1911. !     if (chdir (p->key) < 0)
  1912.           error (1, errno, "could not chdir to %s", p->key);
  1913.   
  1914. --- 631,635 ----
  1915.           if (save_cwd (&cwd))
  1916.           exit (1);
  1917. !     if (CVS_CHDIR (p->key) < 0)
  1918.           error (1, errno, "could not chdir to %s", p->key);
  1919.   
  1920. diff -r -C 2 -P base/cvs-1.6.5/src/release.c cvs-1.6.5/src/release.c
  1921. *** base/cvs-1.6.5/src/release.c    Tue Jan  9 06:20:21 1996
  1922. --- cvs-1.6.5/src/release.c    Tue Jan  9 05:33:08 1996
  1923. ***************
  1924. *** 143,147 ****
  1925.           if (isdir (thisarg))
  1926.           {
  1927. !           if (chdir (thisarg) < 0)
  1928.             {
  1929.               if (!really_quiet)
  1930. --- 143,147 ----
  1931.           if (isdir (thisarg))
  1932.           {
  1933. !           if (CVS_CHDIR (thisarg) < 0)
  1934.             {
  1935.               if (!really_quiet)
  1936. ***************
  1937. *** 273,280 ****
  1938.       ino_t ino;
  1939.   
  1940. !     (void) stat (".", &st);
  1941.       ino = st.st_ino;
  1942. !     (void) chdir ("..");
  1943. !     (void) stat (dir, &st);
  1944.       if (ino != st.st_ino)
  1945.       {
  1946. --- 273,280 ----
  1947.       ino_t ino;
  1948.   
  1949. !     (void) CVS_STAT (".", &st);
  1950.       ino = st.st_ino;
  1951. !     (void) CVS_CHDIR ("..");
  1952. !     (void) CVS_STAT (dir, &st);
  1953.       if (ino != st.st_ino)
  1954.       {
  1955. diff -r -C 2 -P base/cvs-1.6.5/src/remove.c cvs-1.6.5/src/remove.c
  1956. *** base/cvs-1.6.5/src/remove.c    Thu Jan  4 06:20:31 1996
  1957. --- cvs-1.6.5/src/remove.c    Tue Jan  9 05:33:08 1996
  1958. ***************
  1959. *** 128,132 ****
  1960.       if (!noexec)
  1961.       {
  1962. !         if (unlink (file) < 0 && ! existence_error (errno))
  1963.           {
  1964.           if (update_dir[0] == '\0')
  1965. --- 128,132 ----
  1966.       if (!noexec)
  1967.       {
  1968. !         if (CVS_UNLINK (file) < 0 && ! existence_error (errno))
  1969.           {
  1970.           if (update_dir[0] == '\0')
  1971. diff -r -C 2 -P base/cvs-1.6.5/src/root.c cvs-1.6.5/src/root.c
  1972. *** base/cvs-1.6.5/src/root.c    Tue Dec 12 06:20:28 1995
  1973. --- cvs-1.6.5/src/root.c    Tue Jan  9 05:33:08 1996
  1974. ***************
  1975. *** 136,142 ****
  1976.       int ret;
  1977.   
  1978. !     if (stat (dir1, &sb1) < 0)
  1979.           return (0);
  1980. !     if (stat (dir2, &sb2) < 0)
  1981.           return (0);
  1982.       
  1983. --- 136,142 ----
  1984.       int ret;
  1985.   
  1986. !     if (CVS_STAT (dir1, &sb1) < 0)
  1987.           return (0);
  1988. !     if (CVS_STAT (dir2, &sb2) < 0)
  1989.           return (0);
  1990.       
  1991. diff -r -C 2 -P base/cvs-1.6.5/src/rtag.c cvs-1.6.5/src/rtag.c
  1992. *** base/cvs-1.6.5/src/rtag.c    Thu Jan  4 06:20:31 1996
  1993. --- cvs-1.6.5/src/rtag.c    Tue Jan  9 05:33:08 1996
  1994. ***************
  1995. *** 279,283 ****
  1996.   
  1997.       /* chdir to the starting directory */
  1998. !     if (chdir (repository) < 0)
  1999.       {
  2000.       error (0, errno, "cannot chdir to %s", repository);
  2001. --- 279,283 ----
  2002.   
  2003.       /* chdir to the starting directory */
  2004. !     if (CVS_CHDIR (repository) < 0)
  2005.       {
  2006.       error (0, errno, "cannot chdir to %s", repository);
  2007. diff -r -C 2 -P base/cvs-1.6.5/src/run.c cvs-1.6.5/src/run.c
  2008. *** base/cvs-1.6.5/src/run.c    Fri Dec 15 06:20:21 1995
  2009. --- cvs-1.6.5/src/run.c    Tue Jan  9 05:33:08 1996
  2010. ***************
  2011. *** 216,220 ****
  2012.       mode_err |= ((flags & RUN_STDERR_APPEND) ? O_APPEND : O_TRUNC);
  2013.   
  2014. !     if (stin && (shin = open (stin, O_RDONLY)) == -1)
  2015.       {
  2016.       rerrno = errno;
  2017. --- 216,220 ----
  2018.       mode_err |= ((flags & RUN_STDERR_APPEND) ? O_APPEND : O_TRUNC);
  2019.   
  2020. !     if (stin && (shin = CVS_OPEN (stin, O_RDONLY)) == -1)
  2021.       {
  2022.       rerrno = errno;
  2023. ***************
  2024. *** 223,227 ****
  2025.       goto out0;
  2026.       }
  2027. !     if (stout && (shout = open (stout, mode_out, 0666)) == -1)
  2028.       {
  2029.       rerrno = errno;
  2030. --- 223,227 ----
  2031.       goto out0;
  2032.       }
  2033. !     if (stout && (shout = CVS_OPEN (stout, mode_out, 0666)) == -1)
  2034.       {
  2035.       rerrno = errno;
  2036. ***************
  2037. *** 232,236 ****
  2038.       if (sterr && (flags & RUN_COMBINED) == 0)
  2039.       {
  2040. !     if ((sherr = open (sterr, mode_err, 0666)) == -1)
  2041.       {
  2042.           rerrno = errno;
  2043. --- 232,236 ----
  2044.       if (sterr && (flags & RUN_COMBINED) == 0)
  2045.       {
  2046. !     if ((sherr = CVS_OPEN (sterr, mode_err, 0666)) == -1)
  2047.       {
  2048.           rerrno = errno;
  2049. diff -r -C 2 -P base/cvs-1.6.5/src/server.c cvs-1.6.5/src/server.c
  2050. *** base/cvs-1.6.5/src/server.c    Thu Jan  4 06:20:33 1996
  2051. --- cvs-1.6.5/src/server.c    Tue Jan  9 05:33:08 1996
  2052. ***************
  2053. *** 392,396 ****
  2054.       return;
  2055.       }
  2056. !     if (chdir (dirname) < 0)
  2057.       {
  2058.       pending_error = errno;
  2059. --- 392,396 ----
  2060.       return;
  2061.       }
  2062. !     if (CVS_CHDIR (dirname) < 0)
  2063.       {
  2064.       pending_error = errno;
  2065. ***************
  2066. *** 411,415 ****
  2067.       return;
  2068.       }
  2069. !     f = fopen (CVSADM_REP, "w");
  2070.       if (f == NULL)
  2071.       {
  2072. --- 411,415 ----
  2073.       return;
  2074.       }
  2075. !     f = CVS_FOPEN (CVSADM_REP, "w");
  2076.       if (f == NULL)
  2077.       {
  2078. ***************
  2079. *** 428,432 ****
  2080.       return;
  2081.       }
  2082. !     f = fopen (CVSADM_ENT, "w+");
  2083.       if (f == NULL)
  2084.       {
  2085. --- 428,432 ----
  2086.       return;
  2087.       }
  2088. !     f = CVS_FOPEN (CVSADM_ENT, "w+");
  2089.       if (f == NULL)
  2090.       {
  2091. ***************
  2092. *** 493,497 ****
  2093.   {
  2094.       FILE *f;
  2095. !     f = fopen (CVSADM_ENTSTAT, "w+");
  2096.       if (f == NULL)
  2097.       {
  2098. --- 493,497 ----
  2099.   {
  2100.       FILE *f;
  2101. !     f = CVS_FOPEN (CVSADM_ENTSTAT, "w+");
  2102.       if (f == NULL)
  2103.       {
  2104. ***************
  2105. *** 515,519 ****
  2106.   {
  2107.       FILE *f;
  2108. !     f = fopen (CVSADM_TAG, "w+");
  2109.       if (f == NULL)
  2110.       {
  2111. --- 515,519 ----
  2112.   {
  2113.       FILE *f;
  2114. !     f = CVS_FOPEN (CVSADM_TAG, "w+");
  2115.       if (f == NULL)
  2116.       {
  2117. ***************
  2118. *** 626,630 ****
  2119.   
  2120.       /* Write the file.  */
  2121. !     fd = open (arg, O_WRONLY | O_CREAT | O_TRUNC, 0600);
  2122.       if (fd < 0)
  2123.       {
  2124. --- 626,630 ----
  2125.   
  2126.       /* Write the file.  */
  2127. !     fd = CVS_OPEN (arg, O_WRONLY | O_CREAT | O_TRUNC, 0600);
  2128.       if (fd < 0)
  2129.       {
  2130. ***************
  2131. *** 798,802 ****
  2132.       {
  2133.       struct utimbuf ut;
  2134. !     int fd = open (arg, O_WRONLY | O_CREAT | O_TRUNC, 0666);
  2135.       if (fd < 0 || close (fd) < 0)
  2136.       {
  2137. --- 798,802 ----
  2138.       {
  2139.       struct utimbuf ut;
  2140. !     int fd = CVS_OPEN (arg, O_WRONLY | O_CREAT | O_TRUNC, 0666);
  2141.       if (fd < 0 || close (fd) < 0)
  2142.       {
  2143. ***************
  2144. *** 914,918 ****
  2145.       if (!error_pending ())
  2146.       {
  2147. !     f = fopen (CVSADM_ENT, "w");
  2148.       if (f == NULL)
  2149.       {
  2150. --- 914,918 ----
  2151.       if (!error_pending ())
  2152.       {
  2153. !     f = CVS_FOPEN (CVSADM_ENT, "w");
  2154.       if (f == NULL)
  2155.       {
  2156. ***************
  2157. *** 1091,1095 ****
  2158.       while (notify_list != NULL)
  2159.       {
  2160. !     if (chdir (notify_list->dir) < 0)
  2161.       {
  2162.           error (0, errno, "cannot change to %s", notify_list->dir);
  2163. --- 1091,1095 ----
  2164.       while (notify_list != NULL)
  2165.       {
  2166. !     if (CVS_CHDIR (notify_list->dir) < 0)
  2167.       {
  2168.           error (0, errno, "cannot change to %s", notify_list->dir);
  2169. ***************
  2170. *** 2300,2304 ****
  2171.   #endif /* SERVER_FLOWCONTROL */
  2172.   
  2173. !     dev_null_fd = open ("/dev/null", O_RDONLY);
  2174.       if (dev_null_fd < 0)
  2175.       {
  2176. --- 2300,2304 ----
  2177.   #endif /* SERVER_FLOWCONTROL */
  2178.   
  2179. !     dev_null_fd = CVS_OPEN ("/dev/null", O_RDONLY);
  2180.       if (dev_null_fd < 0)
  2181.       {
  2182. ***************
  2183. *** 2943,2947 ****
  2184.       char *mode_string;
  2185.   
  2186. !     if (stat (file, &sb) < 0)
  2187.       {
  2188.           /* Not clear to me why the file would fail to exist, but it
  2189. --- 2943,2947 ----
  2190.       char *mode_string;
  2191.   
  2192. !     if (CVS_STAT (file, &sb) < 0)
  2193.       {
  2194.           /* Not clear to me why the file would fail to exist, but it
  2195. ***************
  2196. *** 3217,3221 ****
  2197.       }
  2198.   
  2199. !     if (chdir (tempdir) < 0)
  2200.       {
  2201.           printf ("E Cannot change to directory %s\n", tempdir);
  2202. --- 3217,3221 ----
  2203.       }
  2204.   
  2205. !     if (CVS_CHDIR (tempdir) < 0)
  2206.       {
  2207.           printf ("E Cannot change to directory %s\n", tempdir);
  2208. ***************
  2209. *** 3283,3287 ****
  2210.       char size_text[80];
  2211.   
  2212. !     if (stat (file, &sb) < 0)
  2213.       {
  2214.           if (existence_error (errno))
  2215. --- 3283,3287 ----
  2216.       char size_text[80];
  2217.   
  2218. !     if (CVS_STAT (file, &sb) < 0)
  2219.       {
  2220.           if (existence_error (errno))
  2221. ***************
  2222. *** 3370,3374 ****
  2223.           pid_t gzip_pid;
  2224.   
  2225. !         fd = open (file, O_RDONLY, 0);
  2226.           if (fd < 0)
  2227.               error (1, errno, "reading %s", short_pathname);
  2228. --- 3370,3374 ----
  2229.           pid_t gzip_pid;
  2230.   
  2231. !         fd = CVS_OPEN (file, O_RDONLY, 0);
  2232.           if (fd < 0)
  2233.               error (1, errno, "reading %s", short_pathname);
  2234. ***************
  2235. *** 3396,3400 ****
  2236.   
  2237.           size = sb.st_size;
  2238. !         f = fopen (file, "r");
  2239.           if (f == NULL)
  2240.               error (1, errno, "reading %s", short_pathname);
  2241. --- 3396,3400 ----
  2242.   
  2243.           size = sb.st_size;
  2244. !         f = CVS_FOPEN (file, "r");
  2245.           if (f == NULL)
  2246.               error (1, errno, "reading %s", short_pathname);
  2247. ***************
  2248. *** 3427,3431 ****
  2249.              join_file.  */
  2250.           && !joining ())
  2251. !         unlink (file);
  2252.       }
  2253.       else if (scratched_file != NULL && entries_line == NULL)
  2254. --- 3427,3431 ----
  2255.              join_file.  */
  2256.           && !joining ())
  2257. !         CVS_UNLINK (file);
  2258.       }
  2259.       else if (scratched_file != NULL && entries_line == NULL)
  2260. ***************
  2261. *** 3673,3677 ****
  2262.   {
  2263.       FILE *f;
  2264. !     f = fopen (CVSADM_CIPROG, "w+");
  2265.       if (f == NULL)
  2266.       {
  2267. --- 3673,3677 ----
  2268.   {
  2269.       FILE *f;
  2270. !     f = CVS_FOPEN (CVSADM_CIPROG, "w+");
  2271.       if (f == NULL)
  2272.       {
  2273. ***************
  2274. *** 3702,3706 ****
  2275.   {
  2276.       FILE *f;
  2277. !     f = fopen (CVSADM_UPROG, "w+");
  2278.       if (f == NULL)
  2279.       {
  2280. --- 3702,3706 ----
  2281.   {
  2282.       FILE *f;
  2283. !     f = CVS_FOPEN (CVSADM_UPROG, "w+");
  2284.       if (f == NULL)
  2285.       {
  2286. ***************
  2287. *** 3919,3923 ****
  2288.       if (temp_dir == NULL || temp_dir[0] == '\0')
  2289.           temp_dir = "/tmp";
  2290. !     chdir(temp_dir);
  2291.   
  2292.       len = strlen (server_temp_dir) + 80;
  2293. --- 3919,3923 ----
  2294.       if (temp_dir == NULL || temp_dir[0] == '\0')
  2295.           temp_dir = "/tmp";
  2296. !     CVS_CHDIR (temp_dir);
  2297.   
  2298.       len = strlen (server_temp_dir) + 80;
  2299. ***************
  2300. *** 4160,4164 ****
  2301.     memset (linebuf, 0, linelen);
  2302.   
  2303. !   fp = fopen (filename, "r");
  2304.     if (fp == NULL)
  2305.       {
  2306. --- 4160,4164 ----
  2307.     memset (linebuf, 0, linelen);
  2308.   
  2309. !   fp = CVS_FOPEN (filename, "r");
  2310.     if (fp == NULL)
  2311.       {
  2312. diff -r -C 2 -P base/cvs-1.6.5/src/tag.c cvs-1.6.5/src/tag.c
  2313. *** base/cvs-1.6.5/src/tag.c    Thu Jan  4 06:20:33 1996
  2314. --- cvs-1.6.5/src/tag.c    Tue Jan  9 05:33:08 1996
  2315. ***************
  2316. *** 729,733 ****
  2317.           if (save_cwd (&cwd))
  2318.           exit (1);
  2319. !         if (chdir (repository) < 0)
  2320.           error (1, errno, "cannot change to %s directory", repository);
  2321.       }
  2322. --- 729,733 ----
  2323.           if (save_cwd (&cwd))
  2324.           exit (1);
  2325. !         if (CVS_CHDIR (repository) < 0)
  2326.           error (1, errno, "cannot change to %s directory", repository);
  2327.       }
  2328. diff -r -C 2 -P base/cvs-1.6.5/src/update.c cvs-1.6.5/src/update.c
  2329. *** base/cvs-1.6.5/src/update.c    Thu Jan  4 06:20:34 1996
  2330. --- cvs-1.6.5/src/update.c    Tue Jan  9 05:33:09 1996
  2331. ***************
  2332. *** 255,259 ****
  2333. --- 255,261 ----
  2334.               if (rq->status == rq_supported)
  2335.               {
  2336. + #ifndef macintosh
  2337.                   send_arg("-u");
  2338. + #endif
  2339.               }
  2340.               break;
  2341. ***************
  2342. *** 275,279 ****
  2343.   
  2344.           if (toplevel_wd[0] != '\0'
  2345. !             && chdir (toplevel_wd) < 0)
  2346.           {
  2347.               error (1, errno, "could not chdir to %s", toplevel_wd);
  2348. --- 277,281 ----
  2349.   
  2350.           if (toplevel_wd[0] != '\0'
  2351. !             && CVS_CHDIR (toplevel_wd) < 0)
  2352.           {
  2353.               error (1, errno, "could not chdir to %s", toplevel_wd);
  2354. ***************
  2355. *** 814,818 ****
  2356.       /* run the update_prog if there is one */
  2357.       if (err == 0 && !pipeout && !noexec &&
  2358. !     (fp = fopen (CVSADM_UPROG, "r")) != NULL)
  2359.       {
  2360.       char *cp;
  2361. --- 816,820 ----
  2362.       /* run the update_prog if there is one */
  2363.       if (err == 0 && !pipeout && !noexec &&
  2364. !     (fp = CVS_FOPEN (CVSADM_UPROG, "r")) != NULL)
  2365.       {
  2366.       char *cp;
  2367. ***************
  2368. *** 837,841 ****
  2369.       /* FIXME: chdir ("..") loses with symlinks.  */
  2370.       /* Prune empty dirs on the way out - if necessary */
  2371. !     (void) chdir ("..");
  2372.       if (update_prune_dirs && isemptydir (dir))
  2373.       {
  2374. --- 839,843 ----
  2375.       /* FIXME: chdir ("..") loses with symlinks.  */
  2376.       /* Prune empty dirs on the way out - if necessary */
  2377. !     (void) CVS_CHDIR ("..");
  2378.       if (update_prune_dirs && isemptydir (dir))
  2379.       {
  2380. ***************
  2381. *** 859,863 ****
  2382.       struct dirent *dp;
  2383.   
  2384. !     if ((dirp = opendir (dir)) == NULL)
  2385.       {
  2386.       error (0, 0, "cannot open directory %s for empty check", dir);
  2387. --- 861,865 ----
  2388.       struct dirent *dp;
  2389.   
  2390. !     if ((dirp = CVS_OPENDIR (dir)) == NULL)
  2391.       {
  2392.       error (0, 0, "cannot open directory %s for empty check", dir);
  2393. ***************
  2394. *** 1207,1211 ****
  2395.       else
  2396.       {
  2397. !         e = fopen (file1, "r");
  2398.       if (e == NULL)
  2399.           fail = 1;
  2400. --- 1209,1213 ----
  2401.       else
  2402.       {
  2403. !         e = CVS_FOPEN (file1, "r");
  2404.       if (e == NULL)
  2405.           fail = 1;
  2406. ***************
  2407. *** 1244,1248 ****
  2408.               && !fileattr_get (file, "_watched"))
  2409.               xchmod (file2, 1);
  2410. !         e = fopen (file2, "r");
  2411.           if (e == NULL)
  2412.               fail = 1;
  2413. --- 1246,1250 ----
  2414.               && !fileattr_get (file, "_watched"))
  2415.               xchmod (file2, 1);
  2416. !         e = CVS_FOPEN (file2, "r");
  2417.           if (e == NULL)
  2418.               fail = 1;
  2419. ***************
  2420. *** 1303,1307 ****
  2421.   
  2422.           /* Check the diff output to make sure patch will be handle it.  */
  2423. !         e = fopen (file, "r");
  2424.           if (e == NULL)
  2425.           error (1, errno, "could not open diff output file %s", file);
  2426. --- 1305,1309 ----
  2427.   
  2428.           /* Check the diff output to make sure patch will be handle it.  */
  2429. !         e = CVS_FOPEN (file, "r");
  2430.           if (e == NULL)
  2431.           error (1, errno, "could not open diff output file %s", file);
  2432. ***************
  2433. *** 1333,1337 ****
  2434.             xvers_ts->tag, xvers_ts->date, NULL);
  2435.   
  2436. !     if (stat (file2, file_info) < 0)
  2437.           error (1, errno, "could not stat %s", file2);
  2438.   
  2439. --- 1335,1339 ----
  2440.             xvers_ts->tag, xvers_ts->date, NULL);
  2441.   
  2442. !     if (CVS_STAT (file2, file_info) < 0)
  2443.           error (1, errno, "could not stat %s", file2);
  2444.   
  2445. diff -r -C 2 -P base/cvs-1.6.5/src/vers_ts.c cvs-1.6.5/src/vers_ts.c
  2446. *** base/cvs-1.6.5/src/vers_ts.c    Sat Dec  2 06:20:24 1995
  2447. --- cvs-1.6.5/src/vers_ts.c    Tue Jan  9 05:33:09 1996
  2448. ***************
  2449. *** 220,224 ****
  2450.       char *cp;
  2451.   
  2452. !     if (stat (file, &sb) < 0)
  2453.       {
  2454.       if (! existence_error (errno))
  2455. --- 220,224 ----
  2456.       char *cp;
  2457.   
  2458. !     if (CVS_STAT (file, &sb) < 0)
  2459.       {
  2460.       if (! existence_error (errno))
  2461. ***************
  2462. *** 280,284 ****
  2463.       char *ts;
  2464.   
  2465. !     if (stat (file, &sb) < 0)
  2466.       {
  2467.       ts = NULL;
  2468. --- 280,284 ----
  2469.       char *ts;
  2470.   
  2471. !     if (CVS_STAT (file, &sb) < 0)
  2472.       {
  2473.       ts = NULL;
  2474. diff -r -C 2 -P base/cvs-1.6.5/src/wrapper.c cvs-1.6.5/src/wrapper.c
  2475. *** base/cvs-1.6.5/src/wrapper.c    Tue Oct 10 07:20:42 1995
  2476. --- cvs-1.6.5/src/wrapper.c    Tue Jan  9 05:33:09 1996
  2477. ***************
  2478. *** 97,101 ****
  2479.   
  2480.       /* load the file */
  2481. !     if (!(fp = fopen (file, "r")))
  2482.       return;
  2483.       while (fgets (line, sizeof (line), fp))
  2484. --- 97,101 ----
  2485.   
  2486.       /* load the file */
  2487. !     if (!(fp = CVS_FOPEN (file, "r")))
  2488.       return;
  2489.       while (fgets (line, sizeof (line), fp))
  2490.