Bug 199440 - typo in man page GPIO(3)
Summary: typo in man page GPIO(3)
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Books & Articles (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-doc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-14 03:44 UTC by waitman
Modified: 2015-07-13 11:03 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!