From 3932da2522ad93a02da3c886853f6f377ba9556b Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Wed, 1 Apr 2009 20:15:48 +0000 Subject: [PATCH] Better errno, from joshe. --- tmux.c | 8 ++++---- 1 file 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 @@ -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); }