Difference for common/porting.c from version 1.16 to 1.17


version 1.16 version 1.17
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_porting_c =   * static char *rcsid_porting_c =
  *   "$Id: porting.c,v 1.16 2002/10/08 06:38:25 mwedel Exp $";   *   "$Id: porting.c,v 1.17 2002/12/03 07:40:10 mwedel Exp $";
  */   */
   
 /*  /*
Line 117
 
Line 117
  struct dirent *de;   struct dirent *de;
   
  for (de=readdir(dirp); de; de = readdir(dirp)) {   for (de=readdir(dirp); de; de = readdir(dirp)) {
      status=stat(de->d_name, &statbuf);       /* Don't remove '.' or '..'  In  theory we should do a better
      /* Linus actually has a type field in the dirent structure,        * check for .., but the directories we are removing are fairly
         * limited and should not have dot files in them.
         */
        if (de->d_name[0] == '.') continue;
   
        /* Linux actually has a type field in the dirent structure,
       * but that is not portable - stat should be portable        * but that is not portable - stat should be portable
       */        */
        status=stat(de->d_name, &statbuf);
      if ((status!=-1) && (S_ISDIR(statbuf.st_mode))) {       if ((status!=-1) && (S_ISDIR(statbuf.st_mode))) {
  sprintf(buf,"%s/%s", path, de->d_name);   sprintf(buf,"%s/%s", path, de->d_name);
  remove_directory(buf);   remove_directory(buf);
  continue;   continue;
      }       }
      /* Don't remove '.' or '..'  In  theory we should do a better   
       * check for .., but the directories we are removing are fairly  
       * limited and should not have dot files in them.  
       */  
      if (de->d_name[0] == '.') continue;  
      sprintf(buf,"%s/%s", path, de->d_name);       sprintf(buf,"%s/%s", path, de->d_name);
      if (unlink(buf)) {       if (unlink(buf)) {
  LOG(llevError,"Unable to remove directory %s\n", path);   LOG(llevError,"Unable to remove directory %s\n", path);
Line 138
 
Line 139
  }   }
  closedir(dirp);   closedir(dirp);
     }      }
     if (unlink(path)) {      if (rmdir(path)) {
  LOG(llevError,"Unable to remove directory %s\n", path);   LOG(llevError,"Unable to remove directory %s\n", path);
     }      }
 }  }


Legend:
line(s) removed in v.1.16 
line(s) changed
 line(s) added in v.1.17

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:16