ls.cpp system call checks fixed