changeset 40745:1622bfdfe454

(sound_perror): Save errno from being clobbered.
author Andreas Schwab <schwab@suse.de>
date Mon, 05 Nov 2001 14:09:18 +0000
parents bf4cd0ec3cfb
children a5268e702a5c
files src/sound.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/sound.c	Mon Nov 05 11:55:58 2001 +0000
+++ b/src/sound.c	Mon Nov 05 14:09:18 2001 +0000
@@ -262,12 +262,14 @@
 sound_perror (msg)
      char *msg;
 {
+  int saved_errno = errno;
+
   turn_on_atimers (1);
 #ifdef SIGIO
   sigunblock (sigmask (SIGIO));
 #endif
-  if (errno != 0)
-    error ("%s: %s", msg, strerror (errno));
+  if (saved_errno != 0)
+    error ("%s: %s", msg, strerror (saved_errno));
   else
     error ("%s", msg);
 }