summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adrien Schildknecht <adrien+dev@schischi.me>2013-07-02 02:50:00 +0200
committerGravatar Adrien Schildknecht <adrien+dev@schischi.me>2013-07-02 02:50:00 +0200
commit3d0a0b310187950c21731a0a37fe5341f860d9e7 (patch)
tree4f8c82b60e13d230577f77ce65a71d4dc9855752
parent49488c0107d1382c65ba9047c38d3a0a160233e0 (diff)
add some logging
-rw-r--r--xcwd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xcwd.c b/xcwd.c
index 82eb7a7..e4fda06 100644
--- a/xcwd.c
+++ b/xcwd.c
@@ -22,7 +22,7 @@
# include <libutil.h>
#endif
-#define DEBUG 1
+#define DEBUG 0
#define XA_STRING (XInternAtom(dpy, "STRING", 0))
#define XA_CARDINAL (XInternAtom(dpy, "CARDINAL", 0))
@@ -211,8 +211,8 @@ static processes_t getProcesses(void)
p->ps[i].ppid = kp[i].ki_ppid;
strncpy(p->ps[i].name, kp[i].ki_tdname, 32);
strncpy(p->ps[i].cwd, kif->kf_path, MAXPATHLEN);
- //fprintf(stderr, "%s (%ld - %ld) - %s\n",p->ps[i].name, p->ps[i].pid,
- // p->ps[i].ppid, p->ps[i].cwd);
+ LOG("\t%-20s\tpid=%6ld\tppid=%6ld\n", p->ps[j].name, p->ps[j].pid,
+ p->ps[j].ppid);
}
}
@@ -238,8 +238,10 @@ static int readPath(struct proc_s *proc)
fprintf(stdout, "%s\n", buf);
#endif
#ifdef BSD
- if(!strlen(proc->cwd))
+ if(!strlen(proc->cwd)) {
+ LOG("%ld cwd is empty\n", proc->pid);
return 0;
+ }
fprintf(stdout, "%s\n", proc->cwd);
#endif
return 1;