summaryrefslogtreecommitdiff
path: root/sway/security.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2016-12-11 14:07:08 -0500
committerGitHub <[email protected]>2016-12-11 14:07:08 -0500
commit6350752d6be2abfac68aa16e891dd859aa5cdafa (patch)
tree18c24336e664111ba9c3a5bfedec5c340ec0a19d /sway/security.c
parentd93e53fd4b57c478097aee899da8226acfe3d318 (diff)
parentda26d69cb1b21d582a81af0cad7342fab6596eed (diff)
Merge pull request #985 from myfreeweb/master
Fix build on FreeBSD
Diffstat (limited to 'sway/security.c')
-rw-r--r--sway/security.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/security.c b/sway/security.c
index f16fdd1f..9cccd62e 100644
--- a/sway/security.c
+++ b/sway/security.c
@@ -28,7 +28,11 @@ struct command_policy *alloc_command_policy(const char *command) {
}
enum secure_feature get_feature_policy(pid_t pid) {
+#ifdef __FreeBSD__
+ const char *fmt = "/proc/%d/file";
+#else
const char *fmt = "/proc/%d/exe";
+#endif
int pathlen = snprintf(NULL, 0, fmt, pid);
char *path = malloc(pathlen + 1);
snprintf(path, pathlen + 1, fmt, pid);