[BACK]Return to server.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/server.c between version 1.13 and 1.14

version 1.13, 2005/04/12 14:58:40 version 1.14, 2005/05/18 20:24:19
Line 25 
Line 25 
  */   */
   
 #include <sys/types.h>  #include <sys/types.h>
   #include <sys/stat.h>
   
 #include <stdlib.h>  #include <stdlib.h>
 #include <stdio.h>  #include <stdio.h>
Line 47 
Line 48 
 struct cvs_cmd_info cmd_server = {  struct cvs_cmd_info cmd_server = {
         NULL, NULL, NULL, NULL, NULL, 0, 0, 0 };          NULL, NULL, NULL, NULL, NULL, 0, 0, 0 };
   
   char cvs_server_tmpdir[MAXPATHLEN];
   
 /*  /*
  * cvs_server()   * cvs_server()
  *   *
Line 61 
Line 64 
 int  int
 cvs_server(int argc, char **argv)  cvs_server(int argc, char **argv)
 {  {
           int l, ret;
         size_t len;          size_t len;
         char reqbuf[512];          char reqbuf[512];
   
Line 72 
Line 76 
         (void)setvbuf(stdin, NULL, _IOLBF, 0);          (void)setvbuf(stdin, NULL, _IOLBF, 0);
         (void)setvbuf(stdout, NULL, _IOLBF, 0);          (void)setvbuf(stdout, NULL, _IOLBF, 0);
   
           /* create the temporary directory */
           l = snprintf(cvs_server_tmpdir, sizeof(cvs_server_tmpdir),
               "%scvs-serv%d", _PATH_TMP, getpid());
           if (l == -1 || l >= (int)sizeof(cvs_server_tmpdir)) {
                   errno = ENAMETOOLONG;
                   cvs_log(LP_ERRNO, "%s", cvs_server_tmpdir);
                   return (CVS_EX_DATA);
           }
   
           if (mkdir(cvs_server_tmpdir, 0700) == -1) {
                   cvs_log(LP_ERRNO, "failed to create temporary directory '%s'",
                       cvs_server_tmpdir);
                   return (CVS_EX_DATA);
           }
   
           if (chdir(cvs_server_tmpdir) == -1) {
                   cvs_log(LP_ERRNO, "failed to change to temporary directory '%s'"
                       , cvs_server_tmpdir);
                   return (CVS_EX_DATA);
           }
   
         for (;;) {          for (;;) {
                 if (fgets(reqbuf, sizeof(reqbuf), stdin) == NULL) {                  if (fgets(reqbuf, sizeof(reqbuf), stdin) == NULL) {
                         if (feof(stdin))                          if (feof(stdin))
Line 94 
Line 119 
   
         }          }
   
         return (0);          /* cleanup the temporary tree */
           ret = cvs_remove_dir(cvs_server_tmpdir);
   
           return (ret);
 }  }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14