diff options
Diffstat (limited to 'src/login/logind-button.c')
-rw-r--r-- | src/login/logind-button.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/login/logind-button.c b/src/login/logind-button.c index 210b889c4f..3324c4622c 100644 --- a/src/login/logind-button.c +++ b/src/login/logind-button.c @@ -240,8 +240,7 @@ int button_open(Button *b) { assert(b); if (b->fd >= 0) { - close(b->fd); - b->fd = -1; + b->fd = safe_close(b->fd); } p = strjoina("/dev/input/", b->name); @@ -267,8 +266,7 @@ int button_open(Button *b) { return 0; fail: - close(b->fd); - b->fd = -1; + b->fd = safe_close(b->fd); return r; } |