Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove debugging printfs in libC fstat()

  • Loading branch information...
commit a88033fbebccc21a3bff90222774d517367eb63f 1 parent 12fe63e
@wolfwood wolfwood authored
Showing with 2 additions and 24 deletions.
  1. +2 −24 user/c/cbindings.d
View
26 user/c/cbindings.d
@@ -210,56 +210,34 @@ int lseek(int file, C.off_t ptr, C.Whence dir) {
int fstat(int file, C.stat *st) {
- logError("FSTAT!\n");
-
if(fdTable[file].valid){
- logError("A\n");
st.st_mode = C.mode_t.init;
- logError("B");
+
if(fdTable[file].device){
- logError("C\n");
st.st_mode = C.mode_t.S_IFCHR|C.mode_t.ACCESSPERMS;
- logError("D\n");
}else if(fdTable[file].dir){
- logError("J\n");
st.st_mode = C.mode_t.S_IFDIR|C.mode_t.ACCESSPERMS;
- logError("K\n");
-
}else{
- logError("E\n");
st.st_mode = C.mode_t.S_IFREG|C.mode_t.ACCESSPERMS;
- logError("F\n");
-
if(fdTable[file].len is null){
- logError("null len\n");
- for(int i = 0; i <= file; i++){
- logError("F");
- }
+ logError("FSTAT on file with null length pointer!\n");
}
//st.st_ino = cast((fdTable[fd].data);
st.st_size = *(fdTable[file].len);
- logError("G\n");
-
st.st_blocks = ((*fdTable[file].len) / 512) + (((*fdTable[file].len)%512) == 0 ? 0 : 1);
-
- logError("H\n");
-
}
return 0;
}else{
- logError("I\n");
errno = C.Errno.EBADF;
return -1;
}
}
int stat(char *file, C.stat *st){
- logError("STAT!\n");
-
int fd = open(file, C.Mode.O_RDONLY);
if(fd >= 0){
Please sign in to comment.
Something went wrong with that request. Please try again.