From owner-freebsd-arch@FreeBSD.ORG Sun Jun 22 00:34:59 2014 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B84DA1FA; Sun, 22 Jun 2014 00:34:59 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D7B22C2; Sun, 22 Jun 2014 00:34:59 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s5M0YrM0006447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Jun 2014 17:34:53 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s5M0YqFE006446; Sat, 21 Jun 2014 17:34:52 -0700 (PDT) (envelope-from jmg) Date: Sat, 21 Jun 2014 17:34:52 -0700 From: John-Mark Gurney To: Rui Paulo Subject: Re: conflict between netif and pccard_ether... Message-ID: <20140622003452.GR31367@funkthat.com> Mail-Followup-To: Rui Paulo , John Baldwin , freebsd-arch@FreeBSD.org References: <20140618231318.GH31367@funkthat.com> <201406190917.16458.jhb@freebsd.org> <20140621104031.GM31367@funkthat.com> <9318E9E1-DF4C-4126-BD93-AF215BE1720A@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="rwgQ89ZNnFUwFHTC" Content-Disposition: inline In-Reply-To: <9318E9E1-DF4C-4126-BD93-AF215BE1720A@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sat, 21 Jun 2014 17:34:53 -0700 (PDT) Cc: freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jun 2014 00:34:59 -0000 --rwgQ89ZNnFUwFHTC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Rui Paulo wrote this message on Sat, Jun 21, 2014 at 09:54 -0700: > On Jun 21, 2014, at 3:40, John-Mark Gurney wrote: > > > > > We would prefer to submit this to the vendor, so if you can, please make sure this code compiles only on FreeBSD while leaving the rest untouched. Whee diff -D! New patch attached... Will you submit it upstream? and when can we expect this to hit head? Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --rwgQ89ZNnFUwFHTC Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="os_unix.c.patch" --- os_unix.c.orig 2014-06-22 07:20:23.000000000 +0700 +++ os_unix.c 2014-06-22 07:32:52.000000000 +0700 @@ -153,16 +153,40 @@ #endif /* __APPLE__ */ +#ifdef __FreeBSD__ +#include +#include +#include +#endif /* __FreeBSD__ */ + int os_daemonize(const char *pid_file) { #if defined(__uClinux__) || defined(__sun__) return -1; #else /* defined(__uClinux__) || defined(__sun__) */ +#ifdef __FreeBSD__ + pid_t otherpid; + struct pidfh *pfh; + + pfh = pidfile_open(pid_file, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(1, "Daemon already running, pid: %jd.", + (intmax_t)otherpid); + } + warn("Cannot open or create pidfile."); + } +#endif /* __FreeBSD__ */ + if (os_daemon(0, 0)) { perror("daemon"); +#ifdef __FreeBSD__ + pidfile_remove(pfh); +#endif /* __FreeBSD__ */ return -1; } +#ifndef __FreeBSD__ if (pid_file) { FILE *f = fopen(pid_file, "w"); if (f) { @@ -170,6 +194,9 @@ fclose(f); } } +#else /* __FreeBSD__ */ + pidfile_write(pfh); +#endif /* __FreeBSD__ */ return -0; #endif /* defined(__uClinux__) || defined(__sun__) */ --rwgQ89ZNnFUwFHTC--