diff options
author | dvdli <70133153+dvdli@users.noreply.github.com> | 2021-07-13 20:01:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 20:01:04 +0800 |
commit | d942aac6f03be52910bd5dcee781facc5cadddae (patch) | |
tree | 5478afd95e668000ce1bcc7f6c79d18adb8d616e | |
parent | cb2790bca6c88adad5cbe1e02789f066b5953f6f (diff) | |
parent | 1d8904826d352a15f7e979dad93fbd6c8cf25b66 (diff) |
Merge pull request #212 from dvdli/fix-closing-pcm-zero-fd
fix the zero fd closing problem
-rw-r--r-- | src/pcm_hw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pcm_hw.c b/src/pcm_hw.c index 4792895..e5588a0 100644 --- a/src/pcm_hw.c +++ b/src/pcm_hw.c @@ -50,7 +50,7 @@ struct pcm_hw_data { /** Device number for the pcm device */ unsigned int device; /** File descriptor to the pcm device file node */ - unsigned int fd; + int fd; /** Pointer to the pcm node from snd card definiton */ struct snd_node *node; }; @@ -59,7 +59,7 @@ static void pcm_hw_close(void *data) { struct pcm_hw_data *hw_data = data; - if (hw_data->fd > 0) + if (hw_data->fd >= 0) close(hw_data->fd); free(hw_data); |