From 278d9f45ab2e89e6887b27768d2a69ebdd54a9ce Mon Sep 17 00:00:00 2001 From: Richard Cochran Date: Wed, 22 Jul 2020 14:49:05 -0700 Subject: [PATCH] ts2phc: Use proper close method on the error path. When creating a ts2phc slave, a clock is obtained by invoking the posix_clock_open() method. However, in case of an error, the same clock is closed again by calling close(2) on the associated file descriptor directly. While not incorrect, still the code should instead use the close function that matches the open method. Signed-off-by: Richard Cochran --- ts2phc_slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts2phc_slave.c b/ts2phc_slave.c index 82848d0..22d00cd 100644 --- a/ts2phc_slave.c +++ b/ts2phc_slave.c @@ -223,7 +223,7 @@ no_ext_ts: no_pin_func: servo_destroy(slave->servo); no_servo: - close(slave->fd); + posix_clock_close(slave->clk); no_posix_clock: free(slave->name); free(slave);