openbsd-ports/misc/xcdroast/patches/patch-io_c
pvalchev 39ef8b05cc Changes from maintainer Jolan Luff <jolan@cryptonomicon.org>
- cast NULL to (void *) in execl call to make sure it is 64 bit
on 64 bit address systems; per new gcc warning
- Respect ${SYSCONFDIR}, ${LOCALBASE}
- fix some formatting
2002-10-13 22:39:45 +00:00

96 lines
2.3 KiB
Plaintext

$OpenBSD: patch-io_c,v 1.2 2002/10/13 22:39:45 pvalchev Exp $
--- io.c.orig Tue May 14 08:37:51 2002
+++ io.c Tue May 14 08:38:12 2002
@@ -20,7 +20,8 @@
# include <sys/soundcard.h>
# include <sys/ioctl.h>
#endif
-#ifdef sun
+#if defined(sun) || defined (__OpenBSD__)
+# include <sys/ioctl.h>
# include <sys/audioio.h>
#endif
#ifdef hpux
@@ -996,7 +997,7 @@ GList *get_dsp_devices() {
GList *dsp;
GList *loop;
struct stat buf;
-#ifdef sun
+#if defined(sun) || defined(__OpenBSD__)
gchar *audiodev;
#endif
dsp = NULL;
@@ -1011,7 +1012,7 @@ gchar *audiodev;
dsp = g_list_append(dsp,"/dev/dsp1");
}
#endif
-#ifdef sun
+#if defined(sun) || defined(__OpenBSD__)
/* check if the user has any special audio-hardware running,
which set the AUDIODEV-environment-variable */
audiodev = getenv("AUDIODEV");
@@ -1084,7 +1085,7 @@ gchar tmp2[MAXLINE];
}
}
#endif
-#ifdef sun
+#if defined(sun) || defined(__OpenBSD__)
g_snprintf(tmp,MAXLINE,"%s%s",dsp,"ctl");
@@ -1991,7 +1992,7 @@ pid_t pid;
}
/* startup child */
- if (execl("/bin/sh", "sh", "-c", cmd ,NULL) < 0) {
+ if (execl("/bin/sh", "sh", "-c", cmd ,(void*)NULL) < 0) {
g_error("execl error\n");
}
@@ -2365,7 +2366,7 @@ gint mix;
#if defined(linux) || defined(__FreeBSD__)
gint val;
#endif
-#ifdef sun
+#if defined(sun) || defined(__OpenBSD__)
audio_info_t ainfo;
#endif
#ifdef hpux
@@ -2400,7 +2401,7 @@ struct audio_gains again;
return ((val & 0x7f) + ((val >> 8) & 0x7f))/2;
#endif
-#ifdef sun
+#if defined(sun) || defined(__OpenBSD__)
dodebug(10,"quering mixer %s\n", setupdata.mix_device);
mix = open(setupdata.mix_device, O_RDONLY);
@@ -2450,7 +2451,7 @@ struct audio_gains again;
gint set_mixer(gint val) {
gint mix;
-#ifdef sun
+#if defined(sun) || defined(__OpenBSD__)
audio_info_t ainfo;
#endif
#ifdef hpux
@@ -2482,7 +2483,7 @@ struct audio_gains again;
close(mix);
#endif
-#ifdef sun
+#if defined(sun) || defined(__OpenBSD__)
dodebug(10,"setting mixer %s to %d\n", setupdata.mix_device, val);
mix = open(setupdata.mix_device, O_WRONLY);
@@ -3275,6 +3276,9 @@ gint ret,found;
/* got the message that no medium is present?
in this case, ignore return code */
if (strstr(line,"medium not present")) {
+ found = 1;
+ }
+ if (strstr(line,"Device not ready")) {
found = 1;
}
}