about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-10-25 16:28:01 +0200
committerLeah Neukirchen <leah@vuxu.org>2022-10-25 16:28:01 +0200
commit36d1ae4563f668a38801f6213023d2202653551f (patch)
tree1ae7e3597d84a47928d09e51a2e363daccbf4943
parent9a0e8cec85194e739e99e297d0cb830db370c73c (diff)
downloadextrace-master.tar.gz
extrace-master.tar.xz
extrace-master.zip
extrace: detect errors when -d is used HEAD master
-rw-r--r--extrace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/extrace.c b/extrace.c
index 2e457f9..99c4aeb 100644
--- a/extrace.c
+++ b/extrace.c
@@ -393,6 +393,10 @@ handle_msg(struct cn_msg *cn_hdr)
 			r3 = readlinkat(proc_dir_fd, "cwd", cwd, sizeof cwd);
 			if (r3 > 0)
 				cwd[r3] = 0;
+			else if (errno == EACCES)
+				strcpy(cwd, "EACCES");
+			else
+				strcpy(cwd, "EUNKNOWN");
 		}
 
 		if (!flat)