Changeset 819 for Whitix/branches

Show
Ignore:
Timestamp:
08/02/08 22:03:13 (5 months ago)
Author:
mwhitworth
Message:

Change behaviour of fruity if file cannot be found.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Whitix/branches/fs/user/fruity/main.c

    r355 r819  
    655655                ret=SysStat(fileName, &stat); 
    656656 
    657                 if (ret) 
     657                if (ret && ret != -ENOENT) 
    658658                { 
    659659                        printf("fruity: could not get information about the file\n"); 
     
    661661                } 
    662662 
    663                 if (stat.mode & _SYS_STAT_FILE) 
    664                 { 
    665                         /* And read it in */ 
    666                         if (ReadFile(fileName)) 
    667                                 return 0; 
    668                 }else{ 
    669                         printf("fruity: %s: could not open directory.\n", fileName); 
    670                         exit(0); 
    671                 } 
     663                if (ret == 0) 
     664                { 
     665                        if (stat.mode & _SYS_STAT_FILE) 
     666                        { 
     667                                /* And read it in */ 
     668                                if (ReadFile(fileName)) 
     669                                        return 0; 
     670                        }else{ 
     671                                printf("fruity: %s: could not open directory.\n", fileName); 
     672                                exit(0); 
     673                        } 
     674                }else 
     675                        NewFile(); 
    672676        }else 
    673677                NewFile();