Bug 199440

Summary: typo in man page GPIO(3)
Product: Documentation Reporter: waitman
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Some People CC: brueffer
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description waitman 2015-04-14 03:44:07 UTC
The example reads:

#include <err.h>
#include <libgpio.h>

gpio_handle_t handle;

handle = gpio_open(0);
if (handle == GPIO_HANDLE_INVALID)
    err(1, "gpio_open failed");



GPIO_HANDLE_INVALID should be GPIO_INVALID_HANDLE as defined in libgpio.h


also, libgpio uses uint32_t but does not #include <sys/types.h>
so for the example to build, must have #include <sys/types.h>
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-07-01 09:25:51 UTC
A commit references this bug:

Author: brueffer
Date: Wed Jul  1 09:25:23 UTC 2015
New revision: 284997
URL: https://svnweb.freebsd.org/changeset/base/284997

Log:
  Make the example code actually work.

  PR:		199440
  Submitted by:	waitman@waitman.net
  Reviewed by:	loos
  MFC after:	1 week

Changes:
  head/lib/libgpio/gpio.3
Comment 2 Christian Brueffer freebsd_committer freebsd_triage 2015-07-01 09:27:03 UTC
Committed to HEAD, I will merge this to the STABLE branch soon.  Thanks for the submission!
Comment 3 Christian Brueffer freebsd_committer freebsd_triage 2015-07-13 11:03:18 UTC
Turns out no merge necessary, since libgpio is only in HEAD.  Thanks again!