diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-08 18:53:19 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-09 08:20:19 +0200 |
commit | 66e405837bf250f50472c886f9c7452634ca3776 (patch) | |
tree | 3692d7ab79969d49ec031c2a5742520cfb500f5f /src/login | |
parent | a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b (diff) |
tree-wide: make more code use safe_close()
Replace this:
close(fd);
fd = -1;
write this:
fd = safe_close(fd);
Diffstat (limited to 'src/login')
-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; } |