Deleted Added
full compact
deviceid.c (185174) deviceid.c (238112)
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/cddl/compat/opensolaris/misc/deviceid.c 185174 2008-11-22 13:33:06Z pjd $");
28__FBSDID("$FreeBSD: head/cddl/compat/opensolaris/misc/deviceid.c 238112 2012-07-04 17:36:26Z pjd $");
29
30#include <sys/param.h>
31#include <sys/ioctl.h>
32#include <stdio.h>
33#include <unistd.h>
34#include <string.h>
35#include <errno.h>
36#include <libgeom.h>
37#include <devid.h>
38
39int
40devid_str_decode(char *devidstr, ddi_devid_t *retdevid, char **retminor_name)
41{
42
43 if (strlcpy(retdevid->devid, devidstr, sizeof(retdevid->devid)) >=
44 sizeof(retdevid->devid)) {
45 return (EINVAL);
46 }
47 *retminor_name = strdup("");
29
30#include <sys/param.h>
31#include <sys/ioctl.h>
32#include <stdio.h>
33#include <unistd.h>
34#include <string.h>
35#include <errno.h>
36#include <libgeom.h>
37#include <devid.h>
38
39int
40devid_str_decode(char *devidstr, ddi_devid_t *retdevid, char **retminor_name)
41{
42
43 if (strlcpy(retdevid->devid, devidstr, sizeof(retdevid->devid)) >=
44 sizeof(retdevid->devid)) {
45 return (EINVAL);
46 }
47 *retminor_name = strdup("");
48 if (*retminor_name == NULL);
48 if (*retminor_name == NULL)
49 return (ENOMEM);
50 return (0);
51}
52
53int
54devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid, char *minor_name,
55 devid_nmlist_t **retlist)
56{

--- 59 unchanged lines hidden ---
49 return (ENOMEM);
50 return (0);
51}
52
53int
54devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid, char *minor_name,
55 devid_nmlist_t **retlist)
56{

--- 59 unchanged lines hidden ---