Module Name: src Committed By: christos Date: Sun Feb 15 21:46:49 UTC 2015
Modified Files: src/sbin/devpubd: Makefile devpubd.c Log Message: let's make this compile again. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/devpubd/Makefile cvs rdiff -u -r1.3 -r1.4 src/sbin/devpubd/devpubd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/devpubd/Makefile diff -u src/sbin/devpubd/Makefile:1.4 src/sbin/devpubd/Makefile:1.5 --- src/sbin/devpubd/Makefile:1.4 Sun Aug 11 02:04:38 2013 +++ src/sbin/devpubd/Makefile Sun Feb 15 16:46:49 2015 @@ -1,8 +1,9 @@ -# $NetBSD: Makefile,v 1.4 2013/08/11 06:04:38 dholland Exp $ +# $NetBSD: Makefile,v 1.5 2015/02/15 21:46:49 christos Exp $ PROG= devpubd SRCS= devpubd.c MAN= devpubd.8 +WARNS= 6 BINDIR?= /sbin Index: src/sbin/devpubd/devpubd.c diff -u src/sbin/devpubd/devpubd.c:1.3 src/sbin/devpubd/devpubd.c:1.4 --- src/sbin/devpubd/devpubd.c:1.3 Sun Feb 15 10:56:30 2015 +++ src/sbin/devpubd/devpubd.c Sun Feb 15 16:46:49 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: devpubd.c,v 1.3 2015/02/15 15:56:30 jmcneill Exp $ */ +/* $NetBSD: devpubd.c,v 1.4 2015/02/15 21:46:49 christos Exp $ */ /*- * Copyright (c) 2011 Jared D. McNeill <jmcne...@invisible.ca> @@ -36,7 +36,7 @@ #include <sys/cdefs.h> __COPYRIGHT("@(#) Copyright (c) 2011-2015\ Jared D. McNeill <jmcne...@invisible.ca>. All rights reserved."); -__RCSID("$NetBSD: devpubd.c,v 1.3 2015/02/15 15:56:30 jmcneill Exp $"); +__RCSID("$NetBSD: devpubd.c,v 1.4 2015/02/15 21:46:49 christos Exp $"); #include <sys/queue.h> #include <sys/types.h> @@ -87,7 +87,8 @@ devpubd_eventhandler(const char *event, { char **argv; pid_t pid; - int status, i, ndevs; + int status; + size_t i, ndevs; for (ndevs = 0, i = 0; device[i] != NULL; i++) { ++ndevs; @@ -95,7 +96,7 @@ devpubd_eventhandler(const char *event, device[i]); } - argv = calloc(3 + ndevs, sizeof(char *)); + argv = calloc(3 + ndevs, sizeof(*argv)); argv[0] = __UNCONST(devpubd_script); argv[1] = __UNCONST(event); for (i = 0; i < ndevs; i++) { @@ -148,7 +149,7 @@ devpubd_eventloop(void) prop_dictionary_get_cstring_nocopy(ev, "device", &device[0]); printf("%s: event='%s', device='%s'\n", __func__, - event, device); + event, device[0]); devpubd_eventhandler(event, device); @@ -227,7 +228,7 @@ devpubd_init(void) { struct devpubd_probe_event *ev; const char **devs; - int ndevs, i; + size_t ndevs, i; TAILQ_INIT(&devpubd_probe_events); devpubd_probe(NULL); @@ -242,7 +243,7 @@ devpubd_init(void) } devpubd_eventhandler(DEVPUBD_ATTACH_EVENT, devs); free(devs); - while (ev = TAILQ_FIRST(&devpubd_probe_events)) { + while ((ev = TAILQ_FIRST(&devpubd_probe_events)) != NULL) { TAILQ_REMOVE(&devpubd_probe_events, ev, entries); free(ev->device); free(ev);