From 82731b30832b61e7d4e26497f6236327be291f0e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 6 Jul 2014 18:29:15 +0200 Subject: mot-encoder: only close directory if slideshow is active --- src/mot-encoder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mot-encoder.cpp') diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp index 1a5ca1e..63b639c 100644 --- a/src/mot-encoder.cpp +++ b/src/mot-encoder.cpp @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { int len, fidx, ret; struct dirent *pDirent; - DIR *pDir; + DIR *pDir = NULL; int padlen = 58; bool erase_after_tx = false; int sleepdelay = 10; @@ -318,7 +318,9 @@ int main(int argc, char *argv[]) sleep(sleepdelay); - closedir(pDir); + if (pDir) { + closedir(pDir); + } } return 1; } -- cgit v1.2.3