From owner-svn-src-head@FreeBSD.ORG Thu Jan 12 22:49:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3963106564A; Thu, 12 Jan 2012 22:49:36 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A84188FC13; Thu, 12 Jan 2012 22:49:36 +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 q0CMna4t030203; Thu, 12 Jan 2012 22:49:36 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CMnaZe030200; Thu, 12 Jan 2012 22:49:36 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201122249.q0CMnaZe030200@svn.freebsd.org> From: Guy Helmer Date: Thu, 12 Jan 2012 22:49:36 +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: r230037 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 22:49:36 -0000 Author: ghelmer Date: Thu Jan 12 22:49:36 2012 New Revision: 230037 URL: http://svn.freebsd.org/changeset/base/230037 Log: Move struct pidfh definition into pidfile.c, and leave a forward declaration for pidfh in libutil.h in its place. This allows us to hide the contents of the pidfh structure, and also allowed removal of the "#ifdef _SYS_PARAM_H" guard from around the pidfile_* function prototypes. Suggested by pjd. Modified: head/lib/libutil/libutil.h head/lib/libutil/pidfile.c Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jan 12 22:30:41 2012 (r230036) +++ head/lib/libutil/libutil.h Thu Jan 12 22:49:36 2012 (r230037) @@ -48,6 +48,11 @@ typedef __gid_t gid_t; #define _GID_T_DECLARED #endif +#ifndef _MODE_T_DECLARED +typedef __mode_t mode_t; +#define _MODE_T_DECLARED +#endif + #ifndef _PID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED @@ -73,21 +78,12 @@ typedef struct _property { char *value; } *properties; -#ifdef _SYS_PARAM_H_ -/* for pidfile.c */ -struct pidfh { - int pf_fd; - char pf_path[MAXPATHLEN + 1]; - __dev_t pf_dev; - ino_t pf_ino; -}; -#endif - /* Avoid pulling in all the include files for no need */ struct in_addr; struct kinfo_file; struct kinfo_proc; struct kinfo_vmentry; +struct pidfh; struct sockaddr; struct termios; struct winsize; @@ -174,14 +170,12 @@ struct group int gr_tmp(int _mdf); #endif -#ifdef _SYS_PARAM_H_ int pidfile_close(struct pidfh *_pfh); int pidfile_fileno(const struct pidfh *_pfh); struct pidfh * pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); int pidfile_remove(struct pidfh *_pfh); int pidfile_write(struct pidfh *_pfh); -#endif #ifdef _UFS_UFS_QUOTA_H_ struct fstab; Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Thu Jan 12 22:30:41 2012 (r230036) +++ head/lib/libutil/pidfile.c Thu Jan 12 22:49:36 2012 (r230037) @@ -41,6 +41,13 @@ __FBSDID("$FreeBSD$"); #include #include +struct pidfh { + int pf_fd; + char pf_path[MAXPATHLEN + 1]; + dev_t pf_dev; + ino_t pf_ino; +}; + static int _pidfile_remove(struct pidfh *pfh, int freeit); static int