diff stream/stream_cue.c @ 35311:18eebabbc172

Do not call fstat if open failed.
author reimar
date Sat, 10 Nov 2012 14:21:16 +0000
parents a010c375947c
children b5abdfe9bc61
line wrap: on
line diff
--- a/stream/stream_cue.c	Sat Nov 10 14:16:33 2012 +0000
+++ b/stream/stream_cue.c	Sat Nov 10 14:21:16 2012 +0000
@@ -249,7 +249,7 @@
       break;
     }
     fd_bin = open(cur_name, O_RDONLY);
-    if (fstat(fd_bin, &filestat) == -1 || !S_ISREG(filestat.st_mode)) {
+    if (fd_bin != -1 && (fstat(fd_bin, &filestat) == -1 || !S_ISREG(filestat.st_mode))) {
         close(fd_bin);
         fd_bin = -1;
     }