core: new error number
authorBartosz Golaszewski <bartekgola@gmail.com>
Mon, 9 Jan 2017 14:08:47 +0000 (15:08 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Mon, 9 Jan 2017 14:08:47 +0000 (15:08 +0100)
Add an error indicating that given line is currently in use.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
core.c
gpiod.h

diff --git a/core.c b/core.c
index eefcff72a21640bf18234d972da0f571b0411535..bd1db6e99dc38ee279c14791241f2a4c8f5d2ebe 100644 (file)
--- a/core.c
+++ b/core.c
@@ -69,6 +69,7 @@ static const char *const error_descr[] = {
        "GPIO line not reserved",
        "no events configured on GPIO line",
        "GPIO lines in bulk don't belong to the same gpiochip",
+       "GPIO line currently in use",
 };
 
 static void set_last_error(int errnum)
diff --git a/gpiod.h b/gpiod.h
index dbb103bd692db36303854cabd44b4ec59f5c3d96..49bcd7f33b46fee64cd7b0fe790ac7bc62c6f221 100644 (file)
--- a/gpiod.h
+++ b/gpiod.h
@@ -83,6 +83,8 @@ enum {
        /**< The caller has not configured any events on this line. */
        GPIOD_EBULKINCOH,
        /**< Not all lines in bulk belong to the same GPIO chip. */
+       GPIOD_ELINEBUSY,
+       /**< This line is currently in use. */
        __GPIOD_MAX_ERR,
        /**< Private: number of libgpiod-specific error numbers. */
 };