subr.c (218214) | subr.c (219815) |
---|---|
1/*- 2 * Copyright (c) 2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Pawel Jakub Dawidek under sponsorship from 6 * the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010 The FreeBSD Foundation 3 * All rights reserved. 4 * 5 * This software was developed by Pawel Jakub Dawidek under sponsorship from 6 * the FreeBSD Foundation. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sbin/hastd/subr.c 218214 2011-02-03 10:37:44Z pjd $"); | 31__FBSDID("$FreeBSD: head/sbin/hastd/subr.c 219815 2011-03-21 08:36:50Z pjd $"); |
32 33#include <sys/types.h> 34#include <sys/disk.h> 35#include <sys/ioctl.h> 36#include <sys/stat.h> 37 38#include <errno.h> 39#include <fcntl.h> 40#include <pwd.h> | 32 33#include <sys/types.h> 34#include <sys/disk.h> 35#include <sys/ioctl.h> 36#include <sys/stat.h> 37 38#include <errno.h> 39#include <fcntl.h> 40#include <pwd.h> |
41#include <stdarg.h> 42#include <stdio.h> 43#include <string.h> |
|
41#include <unistd.h> 42 43#include <pjdlog.h> 44 45#include "hast.h" 46#include "subr.h" 47 48int | 44#include <unistd.h> 45 46#include <pjdlog.h> 47 48#include "hast.h" 49#include "subr.h" 50 51int |
52vsnprlcat(char *str, size_t size, const char *fmt, va_list ap) 53{ 54 size_t len; 55 56 len = strlen(str); 57 return (vsnprintf(str + len, size - len, fmt, ap)); 58} 59 60int 61snprlcat(char *str, size_t size, const char *fmt, ...) 62{ 63 va_list ap; 64 int result; 65 66 va_start(ap, fmt); 67 result = vsnprlcat(str, size, fmt, ap); 68 va_end(ap); 69 return (result); 70} 71 72int |
|
49provinfo(struct hast_resource *res, bool dowrite) 50{ 51 struct stat sb; 52 53 PJDLOG_ASSERT(res->hr_localpath != NULL && 54 res->hr_localpath[0] != '\0'); 55 56 if (res->hr_localfd == -1) { --- 132 unchanged lines hidden --- | 73provinfo(struct hast_resource *res, bool dowrite) 74{ 75 struct stat sb; 76 77 PJDLOG_ASSERT(res->hr_localpath != NULL && 78 res->hr_localpath[0] != '\0'); 79 80 if (res->hr_localfd == -1) { --- 132 unchanged lines hidden --- |