mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2025-12-26 15:40:06 +01:00
util: fix a leaking fd in a test
This commit is contained in:
parent
e3091a1802
commit
bbc1f8de1c
1 changed files with 2 additions and 1 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#include <string.h>
|
||||
|
||||
#include "util-strings.h"
|
||||
#include "util-io.h"
|
||||
|
||||
/**
|
||||
* Return the next word in a string pointed to by state before the first
|
||||
|
|
@ -516,7 +517,7 @@ MUNIT_TEST(test_cmdline_as_str)
|
|||
|
||||
xsnprintf(cmdline, sizeof(cmdline), "/proc/%i/cmdline", getpid());
|
||||
|
||||
int fd = open(cmdline, O_RDONLY);
|
||||
_cleanup_close_ int fd = open(cmdline, O_RDONLY);
|
||||
munit_assert_int(fd, >=, 0);
|
||||
int len = read(fd, cmdline, sizeof(cmdline) - 1);
|
||||
munit_assert_int(len, >=, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue