diff options
author | Adrien Schildknecht <adrien+dev@schischi.me> | 2013-08-04 18:13:54 +0200 |
---|---|---|
committer | Adrien Schildknecht <adrien+dev@schischi.me> | 2013-08-04 18:13:54 +0200 |
commit | 47a4a98da72f29e48c4b133e4d0d00a063e242db (patch) | |
tree | f128059b3007c957aa80a44f6436bb3727452eab | |
parent | 0d8f847bb9e0ed5801fb8730c50c813a4220d671 (diff) |
directory existence test
-rw-r--r-- | xcwd.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -237,6 +237,8 @@ static int readPath(struct proc_s *proc) return 0; } LOG("Read %s\n", path); + if(access(buf, F_OK)) + return 0; fprintf(stdout, "%s\n", buf); #endif #ifdef BSD @@ -244,6 +246,8 @@ static int readPath(struct proc_s *proc) LOG("%ld cwd is empty\n", proc->pid); return 0; } + if(access(proc->cwd, F_OK)) + return 0; fprintf(stdout, "%s\n", proc->cwd); #endif return 1; |