From owner-svn-src-all@FreeBSD.ORG Tue Sep 27 07:52:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 619A5106566B; Tue, 27 Sep 2011 07:52:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46DFC8FC17; Tue, 27 Sep 2011 07:52:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7qexj011403; Tue, 27 Sep 2011 07:52:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7qek7011399; Tue, 27 Sep 2011 07:52:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201109270752.p8R7qek7011399@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 27 Sep 2011 07:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225781 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:52:40 -0000 Author: pjd Date: Tue Sep 27 07:52:39 2011 New Revision: 225781 URL: http://svn.freebsd.org/changeset/base/225781 Log: No need to use KEEP_ERRNO() macro around pjdlog functions, as they don't modify errno. MFC after: 3 days Modified: head/sbin/hastd/proto_tcp.c head/sbin/hastd/subr.c Modified: head/sbin/hastd/proto_tcp.c ============================================================================== --- head/sbin/hastd/proto_tcp.c Tue Sep 27 07:33:04 2011 (r225780) +++ head/sbin/hastd/proto_tcp.c Tue Sep 27 07:52:39 2011 (r225781) @@ -298,8 +298,7 @@ tcp_connect(void *ctx, int timeout) flags = fcntl(tctx->tc_fd, F_GETFL); if (flags == -1) { - KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, - "fcntl(F_GETFL) failed")); + pjdlog_common(LOG_DEBUG, 1, errno, "fcntl(F_GETFL) failed"); return (errno); } /* @@ -308,8 +307,8 @@ tcp_connect(void *ctx, int timeout) */ flags |= O_NONBLOCK; if (fcntl(tctx->tc_fd, F_SETFL, flags) == -1) { - KEEP_ERRNO(pjdlog_common(LOG_DEBUG, 1, errno, - "fcntl(F_SETFL, O_NONBLOCK) failed")); + pjdlog_common(LOG_DEBUG, 1, errno, + "fcntl(F_SETFL, O_NONBLOCK) failed"); return (errno); } Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Tue Sep 27 07:33:04 2011 (r225780) +++ head/sbin/hastd/subr.c Tue Sep 27 07:52:39 2011 (r225781) @@ -87,14 +87,13 @@ provinfo(struct hast_resource *res, bool res->hr_localfd = open(res->hr_localpath, dowrite ? O_RDWR : O_RDONLY); if (res->hr_localfd < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to open %s", - res->hr_localpath)); + pjdlog_errno(LOG_ERR, "Unable to open %s", + res->hr_localpath); return (-1); } } if (fstat(res->hr_localfd, &sb) < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to stat %s", - res->hr_localpath)); + pjdlog_errno(LOG_ERR, "Unable to stat %s", res->hr_localpath); return (-1); } if (S_ISCHR(sb.st_mode)) { @@ -103,16 +102,16 @@ provinfo(struct hast_resource *res, bool */ if (ioctl(res->hr_localfd, DIOCGMEDIASIZE, &res->hr_local_mediasize) < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, + pjdlog_errno(LOG_ERR, "Unable obtain provider %s mediasize", - res->hr_localpath)); + res->hr_localpath); return (-1); } if (ioctl(res->hr_localfd, DIOCGSECTORSIZE, &res->hr_local_sectorsize) < 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, + pjdlog_errno(LOG_ERR, "Unable obtain provider %s sectorsize", - res->hr_localpath)); + res->hr_localpath); return (-1); } } else if (S_ISREG(sb.st_mode)) { @@ -169,8 +168,8 @@ drop_privs(struct hast_resource *res) pw = getpwnam(HAST_USER); if (pw == NULL) { if (errno != 0) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, - "Unable to find info about '%s' user", HAST_USER)); + pjdlog_errno(LOG_ERR, + "Unable to find info about '%s' user", HAST_USER); return (-1); } else { pjdlog_error("'%s' user doesn't exist.", HAST_USER); @@ -201,28 +200,27 @@ drop_privs(struct hast_resource *res) pjdlog_errno(LOG_WARNING, "Unable to jail to directory to %s", pw->pw_dir); if (chroot(pw->pw_dir) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, + pjdlog_errno(LOG_ERR, "Unable to change root directory to %s", - pw->pw_dir)); + pw->pw_dir); return (-1); } } PJDLOG_VERIFY(chdir("/") == 0); gidset[0] = pw->pw_gid; if (setgroups(1, gidset) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, - "Unable to set groups to gid %u", - (unsigned int)pw->pw_gid)); + pjdlog_errno(LOG_ERR, "Unable to set groups to gid %u", + (unsigned int)pw->pw_gid); return (-1); } if (setgid(pw->pw_gid) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to set gid to %u", - (unsigned int)pw->pw_gid)); + pjdlog_errno(LOG_ERR, "Unable to set gid to %u", + (unsigned int)pw->pw_gid); return (-1); } if (setuid(pw->pw_uid) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to set uid to %u", - (unsigned int)pw->pw_uid)); + pjdlog_errno(LOG_ERR, "Unable to set uid to %u", + (unsigned int)pw->pw_uid); return (-1); }