[BACK]Return to patch-hald_freebsd_hf-devd.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / sysutils / hal / patches

File: [cvs.NetBSD.org] / pkgsrc / sysutils / hal / patches / patch-hald_freebsd_hf-devd.c (download)

Revision 1.1, Sat Mar 31 16:06:56 2012 UTC (6 years, 11 months ago) by ryoon
Branch: MAIN
CVS Tags: pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, pkgsrc-, HEAD

Bump PKGREVISION

* Fix build on FreeBSD 9.0
** Patches are borrowed from FreeBSD ports
** Split FreeBSD support from DragonFly/FreeBSD support

$NetBSD: patch-hald_freebsd_hf-devd.c,v 1.1 2012/03/31 16:06:56 ryoon Exp $

* From FreeBSD ports repository to fix build on FreeBSD 9.0 RELEASE.

--- hald/freebsd/hf-devd.c.orig	2009-08-24 12:42:29.000000000 +0000
+++ hald/freebsd/hf-devd.c
@@ -122,7 +122,11 @@ hf_devd_parse_add_remove (const char *ev
   g_return_val_if_fail(parent != NULL, FALSE);
 
   if ((params_ptr = strchr(event, ' '))
+#if defined(__FreeBSD__)
+      && (at_ptr = strstr(params_ptr, "at "))
+#else
       && (at_ptr = strstr(params_ptr + 1, " at "))
+#endif
       && (parent_ptr = strstr(at_ptr + 4, " on ")))
     {
       char *params_str;
@@ -130,7 +134,11 @@ hf_devd_parse_add_remove (const char *ev
 
       *name = g_strndup(event, params_ptr - event);
       params_str = g_strndup(params_ptr + 1, at_ptr - params_ptr - 1);
+#if defined(__FreeBSD__)
+      at_str = g_strndup(at_ptr + 3, parent_ptr - at_ptr - 3);
+#else
       at_str = g_strndup(at_ptr + 4, parent_ptr - at_ptr - 4);
+#endif
       *parent = g_strdup(parent_ptr + 4);
 
       if (! strcmp(*parent, ".")) /* sys/kern/subr_bus.c */
@@ -398,7 +406,11 @@ hf_devd_event_cb (GIOChannel *source, GI
       hf_devd_process_event(event);
       g_free(event);
     }
+#if defined(__FreeBSD__)
+  else if (status == G_IO_STATUS_AGAIN || status == G_IO_STATUS_EOF)
+#else
   else if (status == G_IO_STATUS_AGAIN)
+#endif
     {
       hf_devd_init();
       if (hf_devd_inited)