summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-04-01 20:15:48 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-04-01 20:15:48 +0000
commit3932da2522ad93a02da3c886853f6f377ba9556b (patch)
treeffc261a3b36a9982a8dd26fbc0c0dc61cc47e2f5
parentd4947fc4cbec854762817c2ceadefb3410a66b8f (diff)
Better errno, from joshe.
-rw-r--r--tmux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tmux.c b/tmux.c
index b9639812..46b6fcd8 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.111 2009-04-01 18:21:40 nicm Exp $ */
+/* $Id: tmux.c,v 1.112 2009-04-01 20:15:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -190,11 +190,11 @@ makesockpath(const char *label)
if (lstat(base, &sb) != 0)
return (NULL);
- if (!S_ISDIR(sb.st_mode) || sb.st_uid != uid) {
- errno = EACCES;
+ if (!S_ISDIR(sb.st_mode)) {
+ errno = ENOTDIR;
return (NULL);
}
- if ((sb.st_mode & (S_IRWXG|S_IRWXO)) != 0) {
+ if (sb.st_uid != uid || (sb.st_mode & (S_IRWXG|S_IRWXO)) != 0) {
errno = EACCES;
return (NULL);
}