Skip to content

Commit 0d60d18

Browse files
committed
Review findings
1 parent a4ee7de commit 0d60d18

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/System.Device.Gpio/Interop/Unix/libgpiod/V1/Interop.libgpiod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static LibgpiodV1()
209209
/// </summary>
210210
/// <returns>GPIO chip pointer handle or NULL if an error occurred.</returns>
211211
[DllImport(LibgpiodLibrary, SetLastError = true)]
212-
internal static extern SafeChipHandle gpiod_chip_open_by_number(int number);
212+
internal static extern IntPtr gpiod_chip_open_by_number(int number);
213213

214214
/// <summary>
215215
/// Get the API version of the library as a human-readable string.

src/System.Device.Gpio/System/Device/Gpio/Drivers/Libgpiod/LibGpiodDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public LibGpiodDriver(int gpioChip = 0)
7878
{
7979
_pinNumberLock = new object();
8080
_chipNumber = gpioChip;
81-
_chip = LibgpiodV1.gpiod_chip_open_by_number(gpioChip);
81+
_chip = new SafeChipHandle(LibgpiodV1.gpiod_chip_open_by_number(gpioChip));
8282
if (_chip == null || _chip.IsInvalid || _chip.IsClosed)
8383
{
8484
throw ExceptionHelper.GetIOException(ExceptionResource.NoChipFound, Marshal.GetLastWin32Error());

0 commit comments

Comments
 (0)