summaryrefslogtreecommitdiff
path: root/audio/mpg123/patches/patch-av
blob: 0d702f2631cbc11490d55c715eab76b31de5677d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-av,v 1.2 2008/08/20 22:17:30 martin Exp $

--- xfermem.c.orig	1999-05-27 20:41:10.000000000 +0200
+++ xfermem.c	2008-08-20 16:04:32.000000000 +0200
@@ -32,8 +32,6 @@
 #include <sys/shm.h>
 #endif
 
-extern int errno;
-
 #if defined (USE_MMAP) && defined(MAP_ANONYMOUS) && !defined(MAP_ANON)
 #define MAP_ANON MAP_ANONYMOUS
 #endif
@@ -180,6 +178,15 @@
 				if (FD_ISSET(fd, &selfds))
 					switch (read(fd, &cmd, 1)) {
 						case 0: /* EOF */
+							/*
+							 * We should not check
+							 * errno later on in
+							 * this case, but we
+							 * have to return an
+							 * error code, so it
+							 * will happen.
+							 */
+							errno = 0;
 							return (-1);
 						case -1:
 							if (errno == EINTR)