summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adrien Schildknecht <adrien+dev@schischi.me>2013-08-04 18:13:54 +0200
committerGravatar Adrien Schildknecht <adrien+dev@schischi.me>2013-08-04 18:13:54 +0200
commit47a4a98da72f29e48c4b133e4d0d00a063e242db (patch)
treef128059b3007c957aa80a44f6436bb3727452eab
parent0d8f847bb9e0ed5801fb8730c50c813a4220d671 (diff)
directory existence test
-rw-r--r--xcwd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xcwd.c b/xcwd.c
index 3528af4..4cabf83 100644
--- a/xcwd.c
+++ b/xcwd.c
@@ -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;