Changeset 5578

Show
Ignore:
Timestamp:
07/19/12 16:58:40 (7 years ago)
Author:
cmatthew
Message:

Fixes a bug, which did not return the correct return code on stat, AND blocked correct returning of errno vals.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/branches/nacl_repy/seattlelib/fs_fstat.repy

    r5522 r5578  
    2929    ver = args[1] 
    3030 
    31     print "doing a fstat of", filedes 
    3231    if ver == 1: 
    33         result = pack_stat_struct(fstat_syscall(filedes)) 
     32        try: 
     33            result = fstat_syscall(filedes) 
     34        except SyscallError, e: 
     35            return ErrorResponseBuilder("fs_fxstat", e[1], e[2]) 
     36 
     37        # This format is: dev,ino,mode,nlink,uid,gid,rdev,size,blksize,blocks 
     38        # followed by 2Q for each timestamp.   The ns field is set to 0. 
     39        packed = pack_stat_struct(result) 
     40         
     41        return SuccessResponseBuilder("fs_fxstat", 0, packed) 
     42 
    3443    else: 
    3544        assert False, "not implemented" 
    36  
    37     # This format is: dev,ino,mode,nlink,uid,gid,rdev,size,blksize,blocks 
    38     # followed by 2Q for each timestamp.   The ns field is set to 0. 
    39  
    40     return SuccessResponseBuilder("fs_fstat", len(result), result) 
    4145 
    4246