Bug 203252

Summary: [patch] usbhidaction does not save the right PID in daemon mode
Product: Base System Reporter: Maxime Soulé <btik-fbsd>
Component: usbAssignee: Hans Petter Selasky <hselasky>
Status: Closed FIXED    
Severity: Affects Many People CC: btik-fbsd, hselasky
Priority: --- Keywords: patch
Version: 10.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
usbhidaction.c diff none

Description Maxime Soulé 2015-09-21 21:04:14 UTC
Created attachment 161254 [details]
usbhidaction.c diff

When launched in daemon mode, usbhidaction saves its PID before calling daemon().

The proposed patch corrects this, still failing before daemon() is called, when the PID file cannot be opened.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-09-28 07:23:28 UTC
A commit references this bug:

Author: hselasky
Date: Mon Sep 28 07:23:05 UTC 2015
New revision: 288335
URL: https://svnweb.freebsd.org/changeset/base/288335

Log:
  Store PID after becoming a daemon() and not before to ensure the
  correct PID gets written to the PID file.

  Submitted by:	Maxime Soule <btik-fbsd@scoubidou.com>
  PR:		203252
  MFC after:	2 weeks

Changes:
  head/usr.bin/usbhidaction/usbhidaction.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-10-13 08:19:38 UTC
A commit references this bug:

Author: hselasky
Date: Tue Oct 13 08:19:22 UTC 2015
New revision: 289217
URL: https://svnweb.freebsd.org/changeset/base/289217

Log:
  MFC r288335:
  Store PID after becoming a daemon() and not before to ensure the
  correct PID gets written to the PID file.

  PR:		203252

Changes:
_U  stable/9/usr.bin/
_U  stable/9/usr.bin/usbhidaction/
  stable/9/usr.bin/usbhidaction/usbhidaction.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-10-13 08:21:40 UTC
A commit references this bug:

Author: hselasky
Date: Tue Oct 13 08:21:15 UTC 2015
New revision: 289218
URL: https://svnweb.freebsd.org/changeset/base/289218

Log:
  MFC r288335:
  Store PID after becoming a daemon() and not before to ensure the
  correct PID gets written to the PID file.

  PR:		203252

Changes:
_U  stable/10/
  stable/10/usr.bin/usbhidaction/usbhidaction.c