Ignore:
Timestamp:
Mar 18, 2008, 9:36:56 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Get rid of ugly tabs and trailing spaces everywhere.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/nfclient.cpp

    r123 r124  
    3333extern net_protocol *prot;
    3434
    35 class nfs_file : public bFILE 
     35class nfs_file : public bFILE
    3636{
    3737  jFILE *local;
     
    5959{
    6060  local=NULL;
    61   nfs_fd=-1; 
     61  nfs_fd=-1;
    6262
    6363  int local_only=0;
    6464  char const *s=mode;
    6565  for (;*s;s++)    // check to see if writeable file, if so don't go through nfs
    66     if (*s=='w' || *s=='W' || *s=='a' || *s=='A') 
     66    if (*s=='w' || *s=='W' || *s=='a' || *s=='A')
    6767      local_only=1;
    6868
     
    8787    uint32_t remote_crc=net_crcs->get_crc(remote_file_num,fail2);
    8888    if (!fail2)
    89     {   
     89    {
    9090      int local_file_num=crc_manager.get_filenumber(local_filename);
    9191      uint32_t local_crc=crc_manager.get_crc(local_file_num,fail1);
    9292      if (fail1)
    9393      {
    94         bFILE *fp=new jFILE(local_filename,"rb");     
    95         if (!fp->open_failure())
    96         {
    97           local_crc=crc_file(fp);
    98           crc_manager.set_crc(local_file_num,local_crc);
    99         } else fail3=1;
    100         delete fp;     
     94    bFILE *fp=new jFILE(local_filename,"rb");
     95    if (!fp->open_failure())
     96    {
     97      local_crc=crc_file(fp);
     98      crc_manager.set_crc(local_file_num,local_crc);
     99    } else fail3=1;
     100    delete fp;   
    101101      }
    102102
    103103      if (!fail3)
    104104      {
    105         if (local_crc==remote_crc)
    106           local_only=1; 
     105    if (local_crc==remote_crc)
     106          local_only=1;   
    107107      }
    108108    }
     
    124124    if (nfs_fd==-2)
    125125    {
    126       local=new jFILE(nm,mode);     
     126      local=new jFILE(nm,mode);
    127127      if (local->open_failure()) { delete local; local=NULL; }
    128128      nfs_fd=-1;
     
    132132
    133133
    134 int nfs_file::open_failure() 
    135 { 
     134int nfs_file::open_failure()
     135{
    136136  if (local==NULL && nfs_fd<0) return 1;
    137137  else return 0;
     
    147147    long a=NF_read(nfs_fd,buf,count);
    148148    if (a>(long)count)
    149     { 
     149    {
    150150      fprintf(stderr,"ooch read too much\n");
    151151    }
     
    160160    return local->write(buf,count);
    161161  else
    162   { 
     162  {
    163163    fprintf(stderr,"write to nfs file not allowed for now!\n");
    164164    exit(0);
    165   } 
     165  }
    166166  return 0;
    167167}
     
    178178    else
    179179      return NF_seek(nfs_fd,off);
    180   } 
    181   return 0; 
     180  }
     181  return 0;
    182182}
    183183
     
    216216    net_crcs=new CrcManager();
    217217    if (!net_crcs->load_crc_file(NET_CRC_FILENAME))
    218     { 
    219       delete net_crcs; 
     218    {
     219      delete net_crcs;
    220220      net_crcs=NULL;
    221221      return 0;
Note: See TracChangeset for help on using the changeset viewer.