Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 660
Collapse All | Expand All

(-)wavplay-1.4/Makefile (-8 / +6 lines)
Lines 38-44 Link Here
38
#----------------------------------------------------------------------
38
#----------------------------------------------------------------------
39
# If you are running a 386 you should comment this line out.
39
# If you are running a 386 you should comment this line out.
40
#
40
#
41
CPU=-m486
41
# CPU=-m486
42
42
43
#----------------------------------------------------------------------
43
#----------------------------------------------------------------------
44
# If you are experiencing troubles (like core dumps!), then uncomment
44
# If you are experiencing troubles (like core dumps!), then uncomment
Lines 47-53 Link Here
47
# adjust the STRIP option to suit compile mode:
47
# adjust the STRIP option to suit compile mode:
48
#
48
#
49
#DEBUG=-g
49
#DEBUG=-g
50
OPT=-O2
50
# OPT=-O2
51
51
52
#----------------------------------------------------------------------
52
#----------------------------------------------------------------------
53
# When using 'DEBUG=-g' above, then comment out the 'strip' line:
53
# When using 'DEBUG=-g' above, then comment out the 'strip' line:
Lines 115-121 Link Here
115
# Environment variable WAVPLAYPATH will override this value at runtime, if
115
# Environment variable WAVPLAYPATH will override this value at runtime, if
116
# present.
116
# present.
117
#
117
#
118
PLAYPATH= -DWAVPLAYPATH=\"$(INSTDIR)/wavplay\"
118
PLAYPATH= -DWAVPLAYPATH=\"/usr/bin/wavplay\"
119
119
120
#----------------------------------------------------------------------
120
#----------------------------------------------------------------------
121
# Minimum DSP sampling rate (default is 4000)
121
# Minimum DSP sampling rate (default is 4000)
Lines 164-170 Link Here
164
# installed).
164
# installed).
165
#
165
#
166
#CUSTINCL= -I/usr/X11R6/include/X11 -I/usr/local/lesstif/include/Xm
166
#CUSTINCL= -I/usr/X11R6/include/X11 -I/usr/local/lesstif/include/Xm
167
167
CUSTINCL= -I /usr/X11R6/include
168
#----------------------------------------------------------------------
168
#----------------------------------------------------------------------
169
# Normally, you shouldn't need to change anything beyond this point:
169
# Normally, you shouldn't need to change anything beyond this point:
170
#----------------------------------------------------------------------
170
#----------------------------------------------------------------------
Lines 173-180 Link Here
173
CUSTMOPTS=$(STDGETOPTS) $(PLAYPATH) $(DSPMIN) $(DSPMAX) $(DSPPATH) $(DSPLOCKS) $(USERES) $(NOEDITRES) $(SCHED_PRIORITY)
173
CUSTMOPTS=$(STDGETOPTS) $(PLAYPATH) $(DSPMIN) $(DSPMAX) $(DSPPATH) $(DSPLOCKS) $(USERES) $(NOEDITRES) $(SCHED_PRIORITY)
174
ELF=	# -fPIC
174
ELF=	# -fPIC
175
INCL=	-I. $(CUSTINCL)
175
INCL=	-I. $(CUSTINCL)
176
CCFLAGS= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -fhandle-exceptions $(CUSTMOPTS) -Wall -Wstrict-prototypes
177
CFLAGS= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -Wall -Wstrict-prototypes $(CUSTMOPTS)
178
CC=	gcc
176
CC=	gcc
179
CP=	g++
177
CP=	g++
180
178
Lines 184-193 Link Here
184
WVDMPO= wavdump.o
182
WVDMPO= wavdump.o
185
183
186
.cc.o:
184
.cc.o:
187
	$(CP) $(CCFLAGS) $(INCL) $<
185
	$(CP) -c $(CCFLAGS) $(CUSTMOPTS) $(INCL) $<
188
186
189
.c.o:
187
.c.o:
190
	$(CC) $(CFLAGS) $(INCL) $<
188
	$(CC) -c $(CFLAGS) $(CUSTMOPTS) $(INCL) $<
191
189
192
all:	wavplay wavrec xltwavplay
190
all:	wavplay wavrec xltwavplay
193
191
(-)wavplay-1.4/client.c (-11 / +11 lines)
Lines 135-141 Link Here
135
	 * communications.
135
	 * communications.
136
	 */
136
	 */
137
	if ( (svrIPC = MsgCreate()) < 0 ) {
137
	if ( (svrIPC = MsgCreate()) < 0 ) {
138
		err("%s: creating message queue",sys_errlist[errno]);
138
		err("%s: creating message queue",strerror(errno));
139
		return -1;
139
		return -1;
140
	}
140
	}
141
141
Lines 153-164 Link Here
153
		else	execl(env_WAVPLAYPATH,buf,NULL);	/* No debug yet */
153
		else	execl(env_WAVPLAYPATH,buf,NULL);	/* No debug yet */
154
154
155
		/* Returns only if error occurs */
155
		/* Returns only if error occurs */
156
		fprintf(stderr,"%s: exec of %s\n",sys_errlist[errno],env_WAVPLAYPATH);
156
		fprintf(stderr,"%s: exec of %s\n",strerror(errno),env_WAVPLAYPATH);
157
		exit(2);
157
		exit(2);
158
158
159
	} else if ( svrPID < 0 ) {
159
	} else if ( svrPID < 0 ) {
160
		e = errno;
160
		e = errno;
161
		err("%s: forking the server process",sys_errlist[errno]);
161
		err("%s: forking the server process",strerror(errno));
162
		MsgClose(svrIPC);
162
		MsgClose(svrIPC);
163
		errno = e;			/* Restore error code */
163
		errno = e;			/* Restore error code */
164
		return -1;
164
		return -1;
Lines 216-222 Link Here
216
	if ( (rc = MsgSend(svrIPC,&msg,flags,MSGNO_SRVR)) != 0 && erf != NULL )
216
	if ( (rc = MsgSend(svrIPC,&msg,flags,MSGNO_SRVR)) != 0 && erf != NULL )
217
		err("%s: Sending server message '%s'",
217
		err("%s: Sending server message '%s'",
218
			msg_name(cmd),
218
			msg_name(cmd),
219
			sys_errlist[errno]);
219
			strerror(errno));
220
	return rc;				/* Zero indicates success */
220
	return rc;				/* Zero indicates success */
221
}
221
}
222
222
Lines 236-242 Link Here
236
	msg.bytes = strlen(msg.u.tosvr_path.path);
236
	msg.bytes = strlen(msg.u.tosvr_path.path);
237
237
238
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
238
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
239
		err("%s: Sending server message 'path'",sys_errlist[errno]);
239
		err("%s: Sending server message 'path'",strerror(errno));
240
	return z;
240
	return z;
241
}
241
}
242
242
Lines 255-261 Link Here
255
	msg.bytes = sizeof msg.u.tosvr_bits;
255
	msg.bytes = sizeof msg.u.tosvr_bits;
256
256
257
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
257
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
258
		err("%s: Sending server message 'bits'",sys_errlist[errno]);
258
		err("%s: Sending server message 'bits'",strerror(errno));
259
259
260
	return z;
260
	return z;
261
}
261
}
Lines 275-281 Link Here
275
       msg.bytes = sizeof msg.u.tosvr_start_sample;
275
       msg.bytes = sizeof msg.u.tosvr_start_sample;
276
276
277
       if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
277
       if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
278
               err("%s: Sending server message 'start_sample'",sys_errlist[errno]);
278
               err("%s: Sending server message 'start_sample'",strerror(errno));
279
279
280
       return z;
280
       return z;
281
}
281
}
Lines 294-300 Link Here
294
	msg.bytes = sizeof msg.u.tosvr_sampling_rate;
294
	msg.bytes = sizeof msg.u.tosvr_sampling_rate;
295
295
296
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
296
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
297
		err("%s: Sending server message 'sampling_rate'",sys_errlist[errno]);
297
		err("%s: Sending server message 'sampling_rate'",strerror(errno));
298
298
299
	return z;
299
	return z;
300
}
300
}
Lines 314-320 Link Here
314
	msg.bytes = sizeof msg.u.tosvr_chan;
314
	msg.bytes = sizeof msg.u.tosvr_chan;
315
	
315
	
316
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
316
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
317
		err("%s: Sending server message 'tosvr_chan'",sys_errlist[errno]);
317
		err("%s: Sending server message 'tosvr_chan'",strerror(errno));
318
318
319
	return z;
319
	return z;
320
}
320
}
Lines 336-342 Link Here
336
	msg.bytes = sizeof msg.u.tosvr_record;
336
	msg.bytes = sizeof msg.u.tosvr_record;
337
	
337
	
338
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
338
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
339
		err("%s: Sending server message 'tosvr_record'",sys_errlist[errno]);
339
		err("%s: Sending server message 'tosvr_record'",strerror(errno));
340
340
341
	return z;
341
	return z;
342
}
342
}
Lines 356-362 Link Here
356
	msg.bytes = sizeof msg.u.tosvr_debug;
356
	msg.bytes = sizeof msg.u.tosvr_debug;
357
	
357
	
358
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
358
	if ( (z = MsgToServer(svrIPC,&msg,flags)) != 0 && erf != NULL )
359
		err("%s: Sending server message 'tosvr_debug'",sys_errlist[errno]);
359
		err("%s: Sending server message 'tosvr_debug'",strerror(errno));
360
360
361
	return z;
361
	return z;
362
}
362
}
(-)wavplay-1.4/file.c (-38 / +38 lines)
Lines 106-112 Link Here
106
	WAVFILE *wfile = (WAVFILE *) malloc(sizeof (WAVFILE));
106
	WAVFILE *wfile = (WAVFILE *) malloc(sizeof (WAVFILE));
107
107
108
	if ( wfile == NULL ) {
108
	if ( wfile == NULL ) {
109
		err("%s: Allocating WAVFILE structure",sys_errlist[ENOMEM]);
109
		err("%s: Allocating WAVFILE structure",strerror(ENOMEM));
110
		return NULL;
110
		return NULL;
111
	}
111
	}
112
112
Lines 114-120 Link Here
114
114
115
	if ( (wfile->Pathname = strdup(Pathname)) == NULL ) {
115
	if ( (wfile->Pathname = strdup(Pathname)) == NULL ) {
116
		free(wfile);
116
		free(wfile);
117
		err("%s: Allocating storage for WAVFILE.Pathname",sys_errlist[ENOMEM]);
117
		err("%s: Allocating storage for WAVFILE.Pathname",strerror(ENOMEM));
118
		return NULL;
118
		return NULL;
119
	}
119
	}
120
120
Lines 166-179 Link Here
166
	 */
166
	 */
167
	if ( (wfile->fd = open(wfile->Pathname,O_RDONLY)) < 0 ) {
167
	if ( (wfile->fd = open(wfile->Pathname,O_RDONLY)) < 0 ) {
168
		err("%s:\nOpening WAV file %s",
168
		err("%s:\nOpening WAV file %s",
169
			sys_errlist[errno],
169
			strerror(errno),
170
			wfile->Pathname);
170
			wfile->Pathname);
171
		goto errxit;
171
		goto errxit;
172
	}
172
	}
173
173
174
	if ( lseek(wfile->fd,0L,SEEK_SET) != 0L ) {
174
	if ( lseek(wfile->fd,0L,SEEK_SET) != 0L ) {
175
		err("%s:\nRewinding WAV file %s",
175
		err("%s:\nRewinding WAV file %s",
176
			sys_errlist[errno],
176
			strerror(errno),
177
			wfile->Pathname);
177
			wfile->Pathname);
178
		goto errxit;		/* Wav file must be seekable device */
178
		goto errxit;		/* Wav file must be seekable device */
179
	}
179
	}
Lines 205-216 Link Here
205
	 * Seek to byte count and read dbytes:
205
	 * Seek to byte count and read dbytes:
206
	 */
206
	 */
207
	if ( lseek(wfile->fd,offset,SEEK_SET) != offset ) {
207
	if ( lseek(wfile->fd,offset,SEEK_SET) != offset ) {
208
		err("%s:\nSeeking to WAV data in %s",sys_errlist[errno],wfile->Pathname);
208
		err("%s:\nSeeking to WAV data in %s",strerror(errno),wfile->Pathname);
209
		goto errxit;			/* Seek failure */
209
		goto errxit;			/* Seek failure */
210
	}
210
	}
211
211
212
	if ( read(wfile->fd,ubuf,4) != 4 ) {
212
	if ( read(wfile->fd,ubuf,4) != 4 ) {
213
		err("%s:\nReading dbytes from %s",sys_errlist[errno],wfile->Pathname);
213
		err("%s:\nReading dbytes from %s",strerror(errno),wfile->Pathname);
214
		goto errxit;
214
		goto errxit;
215
	}
215
	}
216
216
Lines 308-314 Link Here
308
	v_erf = erf;				/* Set error reporting function */
308
	v_erf = erf;				/* Set error reporting function */
309
309
310
	if ( wfile == NULL ) {
310
	if ( wfile == NULL ) {
311
		err("%s: WAVFILE pointer is NULL!",sys_errlist[EINVAL]);
311
		err("%s: WAVFILE pointer is NULL!",strerror(EINVAL));
312
		errno = EINVAL;
312
		errno = EINVAL;
313
		return -1;
313
		return -1;
314
	}
314
	}
Lines 322-330 Link Here
322
		if ( (e = WaveReadHeader(wfile->fd,&channels,&samplerate,&sample_bits,&samples,&datastart,_v_erf)) != 0 )
322
		if ( (e = WaveReadHeader(wfile->fd,&channels,&samplerate,&sample_bits,&samples,&datastart,_v_erf)) != 0 )
323
			err("%s:\nReading WAV header from %s",emsg,wfile->Pathname);
323
			err("%s:\nReading WAV header from %s",emsg,wfile->Pathname);
324
		else if ( lseek(wfile->fd,(long)(datastart-4),SEEK_SET) != (long)(datastart-4) )
324
		else if ( lseek(wfile->fd,(long)(datastart-4),SEEK_SET) != (long)(datastart-4) )
325
			err("%s:\nSeeking in WAV header file %s",sys_errlist[errno],wfile->Pathname);
325
			err("%s:\nSeeking in WAV header file %s",strerror(errno),wfile->Pathname);
326
		else if ( write(wfile->fd,&wfile->wavinfo.Samples,sizeof wfile->wavinfo.Samples) != sizeof wfile->wavinfo.Samples )
326
		else if ( write(wfile->fd,&wfile->wavinfo.Samples,sizeof wfile->wavinfo.Samples) != sizeof wfile->wavinfo.Samples )
327
			err("%s:\nWriting in WAV header file %s",sys_errlist[errno],wfile->Pathname);
327
			err("%s:\nWriting in WAV header file %s",strerror(errno),wfile->Pathname);
328
		else	{
328
		else	{
329
			/*
329
			/*
330
			 * 'data' chunk was updated OK: Now we have to update the RIFF block
330
			 * 'data' chunk was updated OK: Now we have to update the RIFF block
Lines 333-356 Link Here
333
			 */
333
			 */
334
			if ( ftruncate(wfile->fd,(size_t)fpos) )
334
			if ( ftruncate(wfile->fd,(size_t)fpos) )
335
				err("%s:\nTruncating file %s to correct size",
335
				err("%s:\nTruncating file %s to correct size",
336
					sys_errlist[errno],
336
					strerror(errno),
337
					wfile->Pathname);
337
					wfile->Pathname);
338
			else if ( lseek(wfile->fd,4L,SEEK_SET) < 0L )
338
			else if ( lseek(wfile->fd,4L,SEEK_SET) < 0L )
339
				err("%s:\nSeek 4 for RIFF block update of %s",
339
				err("%s:\nSeek 4 for RIFF block update of %s",
340
					sys_errlist[errno],
340
					strerror(errno),
341
					wfile->Pathname);
341
					wfile->Pathname);
342
			else	{
342
			else	{
343
				fpos -= 8;		/* Byte count for RIFF block */
343
				fpos -= 8;		/* Byte count for RIFF block */
344
				if ( write(wfile->fd,&fpos,sizeof fpos) != sizeof fpos )
344
				if ( write(wfile->fd,&fpos,sizeof fpos) != sizeof fpos )
345
					err("%s:\nUpdate of RIFF block count in %s failed",
345
					err("%s:\nUpdate of RIFF block count in %s failed",
346
						sys_errlist[errno],
346
						strerror(errno),
347
						wfile->Pathname);
347
						wfile->Pathname);
348
			}
348
			}
349
		}
349
		}
350
	}
350
	}
351
351
352
	if ( close(wfile->fd) < 0 ) {
352
	if ( close(wfile->fd) < 0 ) {
353
		err("%s:\nClosing WAV file",sys_errlist[errno]);
353
		err("%s:\nClosing WAV file",strerror(errno));
354
		e = errno;			/* Save errno value to return */
354
		e = errno;			/* Save errno value to return */
355
	}
355
	}
356
356
Lines 385-391 Link Here
385
	 */
385
	 */
386
	if ( (wfile->fd = open(wfile->Pathname,O_RDWR|O_TRUNC|O_CREAT,0666)) < 0 ) {
386
	if ( (wfile->fd = open(wfile->Pathname,O_RDWR|O_TRUNC|O_CREAT,0666)) < 0 ) {
387
		err("%s:\nOpening %s for WAV writing",
387
		err("%s:\nOpening %s for WAV writing",
388
			sys_errlist[errno],
388
			strerror(errno),
389
			wfile->Pathname);
389
			wfile->Pathname);
390
		return NULL;			/* Open error */
390
		return NULL;			/* Open error */
391
	}
391
	}
Lines 427-433 Link Here
427
	v_erf = erf;				/* Set error reporting function */
427
	v_erf = erf;				/* Set error reporting function */
428
428
429
	if ( dfile == NULL ) {
429
	if ( dfile == NULL ) {
430
		err("%s: Opening DSP device",sys_errlist[errno=ENOMEM]);
430
		err("%s: Opening DSP device",strerror(errno=ENOMEM));
431
		return NULL;
431
		return NULL;
432
	}
432
	}
433
433
Lines 439-445 Link Here
439
	 */
439
	 */
440
	if ( (dfile->fd = open(env_AUDIODEV,omode,0)) < 0 ) {
440
	if ( (dfile->fd = open(env_AUDIODEV,omode,0)) < 0 ) {
441
		err("%s:\nOpening audio device %s",
441
		err("%s:\nOpening audio device %s",
442
			sys_errlist[errno],
442
			strerror(errno),
443
			env_AUDIODEV);
443
			env_AUDIODEV);
444
		goto errxit;
444
		goto errxit;
445
	}
445
	}
Lines 449-455 Link Here
449
         * setting sampling rate etc.
449
         * setting sampling rate etc.
450
         */
450
         */
451
        if ( ioctl(dfile->fd,SNDCTL_DSP_GETBLKSIZE,&dfile->dspblksiz) < 0 ) {
451
        if ( ioctl(dfile->fd,SNDCTL_DSP_GETBLKSIZE,&dfile->dspblksiz) < 0 ) {
452
                err("%s: Optaining DSP's block size",sys_errlist[errno]);
452
                err("%s: Optaining DSP's block size",strerror(errno));
453
                goto errxit;
453
                goto errxit;
454
        }
454
        }
455
 
455
 
Lines 460-466 Link Here
460
        /* and 64 for 8130Hz, 8 bit */
460
        /* and 64 for 8130Hz, 8 bit */
461
        if ( dfile->dspblksiz < 32 || dfile->dspblksiz > 65536 ) {
461
        if ( dfile->dspblksiz < 32 || dfile->dspblksiz > 65536 ) {
462
                err("%s: Audio block size (%d bytes)",
462
                err("%s: Audio block size (%d bytes)",
463
                        sys_errlist[errno=EINVAL],
463
                        strerror(errno=EINVAL),
464
                        (int)dfile->dspblksiz);
464
                        (int)dfile->dspblksiz);
465
                goto errxit;
465
                goto errxit;
466
        }
466
        }
Lines 469-475 Link Here
469
         * Allocate a buffer to do the I/O through:
469
         * Allocate a buffer to do the I/O through:
470
         */
470
         */
471
        if ( (dfile->dspbuf = (char *) malloc(dfile->dspblksiz)) == NULL ) {
471
        if ( (dfile->dspbuf = (char *) malloc(dfile->dspblksiz)) == NULL ) {
472
                err("%s: For DSP I/O buffer",sys_errlist[errno]);
472
                err("%s: For DSP I/O buffer",strerror(errno));
473
                goto errxit;
473
                goto errxit;
474
        }
474
        }
475
475
Lines 478-484 Link Here
478
	 */
478
	 */
479
	t = wfile->wavinfo.DataBits;
479
	t = wfile->wavinfo.DataBits;
480
        if ( ioctl(dfile->fd,SNDCTL_DSP_SAMPLESIZE,&t) < 0 ) {
480
        if ( ioctl(dfile->fd,SNDCTL_DSP_SAMPLESIZE,&t) < 0 ) {
481
		err("%s: Setting DSP to %u bits",sys_errlist[errno],(unsigned)t);
481
		err("%s: Setting DSP to %u bits",strerror(errno),(unsigned)t);
482
		goto errxit;
482
		goto errxit;
483
	}
483
	}
484
484
Lines 488-494 Link Here
488
	t = wfile->wavinfo.Channels == Stereo ? 1 : 0;
488
	t = wfile->wavinfo.Channels == Stereo ? 1 : 0;
489
	if ( ioctl(dfile->fd,SNDCTL_DSP_STEREO,&t) < 0 ) {
489
	if ( ioctl(dfile->fd,SNDCTL_DSP_STEREO,&t) < 0 ) {
490
		err("%s: Unable to set DSP to %s mode",
490
		err("%s: Unable to set DSP to %s mode",
491
			sys_errlist[errno],
491
			strerror(errno),
492
			t?"Stereo":"Mono");
492
			t?"Stereo":"Mono");
493
		goto errxit;
493
		goto errxit;
494
	}		
494
	}		
Lines 498-504 Link Here
498
	 */
498
	 */
499
	ul = wfile->wavinfo.SamplingRate;
499
	ul = wfile->wavinfo.SamplingRate;
500
	if ( ioctl(dfile->fd,SNDCTL_DSP_SPEED,&ul) < 0 ) {
500
	if ( ioctl(dfile->fd,SNDCTL_DSP_SPEED,&ul) < 0 ) {
501
		err("Unable to set audio sampling rate",sys_errlist[errno]);
501
		err("Unable to set audio sampling rate",strerror(errno));
502
		goto errxit;
502
		goto errxit;
503
	}
503
	}
504
504
Lines 530-536 Link Here
530
	v_erf = erf;				/* Set error reporting function */
530
	v_erf = erf;				/* Set error reporting function */
531
531
532
	if ( dfile == NULL ) {
532
	if ( dfile == NULL ) {
533
		err("%s: DSPFILE is not open",sys_errlist[errno=EINVAL]);
533
		err("%s: DSPFILE is not open",strerror(errno=EINVAL));
534
		return -1;
534
		return -1;
535
	}
535
	}
536
536
Lines 540-546 Link Here
540
	free(dfile);
540
	free(dfile);
541
	
541
	
542
	if ( close(fd) ) {
542
	if ( close(fd) ) {
543
		err("%s: Closing DSP fd %d",sys_errlist[errno],fd);
543
		err("%s: Closing DSP fd %d",strerror(errno),fd);
544
		return -1;
544
		return -1;
545
	}
545
	}
546
546
Lines 565-571 Link Here
565
	 * Check that the WAVFILE is open for reading:
565
	 * Check that the WAVFILE is open for reading:
566
	 */
566
	 */
567
	if ( wfile->rw != 'R' ) {
567
	if ( wfile->rw != 'R' ) {
568
		err("%s: WAVFILE must be open for reading",sys_errlist[errno=EINVAL]);
568
		err("%s: WAVFILE must be open for reading",strerror(errno=EINVAL));
569
		return -1;
569
		return -1;
570
	}
570
	}
571
571
Lines 581-587 Link Here
581
		break;
581
		break;
582
	default :
582
	default :
583
		err("%s: Cannot process %u bit samples",
583
		err("%s: Cannot process %u bit samples",
584
			sys_errlist[errno=EINVAL],
584
			strerror(errno=EINVAL),
585
			(unsigned)wfile->wavinfo.DataBits);
585
			(unsigned)wfile->wavinfo.DataBits);
586
		return -1;
586
		return -1;
587
	}
587
	}
Lines 593-599 Link Here
593
		byte_count *= 2;		/* Twice as many bytes for stereo */
593
		byte_count *= 2;		/* Twice as many bytes for stereo */
594
	else if ( wfile->wavinfo.Channels != Mono ) {
594
	else if ( wfile->wavinfo.Channels != Mono ) {
595
		err("%s: DSPFILE control block is corrupted (chan_mode)",
595
		err("%s: DSPFILE control block is corrupted (chan_mode)",
596
			sys_errlist[errno=EINVAL]);
596
			strerror(errno=EINVAL));
597
		return -1;
597
		return -1;
598
	}		
598
	}		
599
599
Lines 606-612 Link Here
606
        update_bytes = ((wfile->wavinfo.SamplingRate*byte_modulo) / (RECPLAY_UPDATES_PER_SEC*dfile->dspblksiz)) * dfile->dspblksiz;
606
        update_bytes = ((wfile->wavinfo.SamplingRate*byte_modulo) / (RECPLAY_UPDATES_PER_SEC*dfile->dspblksiz)) * dfile->dspblksiz;
607
607
608
	if ( ioctl(dfile->fd,SNDCTL_DSP_SYNC,0) != 0 )
608
	if ( ioctl(dfile->fd,SNDCTL_DSP_SYNC,0) != 0 )
609
		err("%s: ioctl(%d,SNDCTL_DSP_SYNC,0)",sys_errlist[errno]);
609
		err("%s: ioctl(%d,SNDCTL_DSP_SYNC,0)",strerror(errno));
610
610
611
        /* Seek to requested start sample */
611
        /* Seek to requested start sample */
612
        lseek(wfile->fd,wfile->StartSample*byte_modulo,SEEK_CUR);
612
        lseek(wfile->fd,wfile->StartSample*byte_modulo,SEEK_CUR);
Lines 620-627 Link Here
620
620
621
		if ( (n = read(wfile->fd,dfile->dspbuf,bytes)) != bytes ) {
621
		if ( (n = read(wfile->fd,dfile->dspbuf,bytes)) != bytes ) {
622
			if ( n >= 0 )
622
			if ( n >= 0 )
623
				err("Unexpected EOF reading samples from WAV file",sys_errlist[errno=EIO]);
623
				err("Unexpected EOF reading samples from WAV file",strerror(errno=EIO));
624
			else	err("Reading samples from WAV file",sys_errlist[errno]);
624
			else	err("Reading samples from WAV file",strerror(errno));
625
			goto errxit;
625
			goto errxit;
626
		}
626
		}
627
627
Lines 635-641 Link Here
635
                }
635
                }
636
636
637
		if ( write(dfile->fd,dfile->dspbuf,n) != n ) {
637
		if ( write(dfile->fd,dfile->dspbuf,n) != n ) {
638
			err("Writing samples to audio device",sys_errlist[errno]);
638
			err("Writing samples to audio device",strerror(errno));
639
			goto errxit;
639
			goto errxit;
640
		}
640
		}
641
641
Lines 651-657 Link Here
651
			
651
			
652
#if 0	/* I think this is doing a destructive flush: disabled */
652
#if 0	/* I think this is doing a destructive flush: disabled */
653
	if ( ioctl(dfile->fd,SNDCTL_DSP_SYNC,0) != 0 )
653
	if ( ioctl(dfile->fd,SNDCTL_DSP_SYNC,0) != 0 )
654
		err("%s: ioctl(%d,SNDCTL_DSP_SYNC,0)",sys_errlist[errno]);
654
		err("%s: ioctl(%d,SNDCTL_DSP_SYNC,0)",strerror(errno));
655
#endif
655
#endif
656
        /* Update client time display at end of sucessful play */
656
        /* Update client time display at end of sucessful play */
657
        if (clntIPC >= 0) {
657
        if (clntIPC >= 0) {
Lines 688-694 Link Here
688
	 * Check that the WAVFILE is open for writing:
688
	 * Check that the WAVFILE is open for writing:
689
	 */
689
	 */
690
	if ( wfile->rw != 'W' ) {
690
	if ( wfile->rw != 'W' ) {
691
		err("WAVFILE must be open for writing",sys_errlist[errno=EINVAL]);
691
		err("WAVFILE must be open for writing",strerror(errno=EINVAL));
692
		return -1;
692
		return -1;
693
	}
693
	}
694
694
Lines 705-711 Link Here
705
		break;
705
		break;
706
	default :
706
	default :
707
		err("Cannot process %u bit samples",
707
		err("Cannot process %u bit samples",
708
			sys_errlist[errno=EINVAL],
708
			strerror(errno=EINVAL),
709
			(unsigned)wfile->wavinfo.DataBits);
709
			(unsigned)wfile->wavinfo.DataBits);
710
		return -1;
710
		return -1;
711
	}
711
	}
Lines 716-722 Link Here
716
	if ( wfile->wavinfo.Channels == Stereo )
716
	if ( wfile->wavinfo.Channels == Stereo )
717
		byte_count *= 2;		/* Twice as many bytes for stereo */
717
		byte_count *= 2;		/* Twice as many bytes for stereo */
718
	else if ( wfile->wavinfo.Channels != Mono ) {
718
	else if ( wfile->wavinfo.Channels != Mono ) {
719
		err("DSPFILE control block is corrupted (chan_mode)",sys_errlist[errno=EINVAL]);
719
		err("DSPFILE control block is corrupted (chan_mode)",strerror(errno=EINVAL));
720
		return -1;
720
		return -1;
721
	}		
721
	}		
722
722
Lines 747-753 Link Here
747
		 * Read a block of samples:
747
		 * Read a block of samples:
748
		 */
748
		 */
749
		if ( (n = read(dfile->fd,dfile->dspbuf,bytes)) < 0 ) {
749
		if ( (n = read(dfile->fd,dfile->dspbuf,bytes)) < 0 ) {
750
			err("Reading DSP device",sys_errlist[errno]);
750
			err("Reading DSP device",strerror(errno));
751
			goto errxit;
751
			goto errxit;
752
		} else if ( n == 0 )
752
		} else if ( n == 0 )
753
			break;
753
			break;
Lines 756-767 Link Here
756
		 * Write a block of samples to the file:
756
		 * Write a block of samples to the file:
757
		 */
757
		 */
758
		if ( (bytes = write(wfile->fd,dfile->dspbuf,n)) < 0 ) {
758
		if ( (bytes = write(wfile->fd,dfile->dspbuf,n)) < 0 ) {
759
			err("Writing WAV samples to %s",sys_errlist[errno],wfile->Pathname);
759
			err("Writing WAV samples to %s",strerror(errno),wfile->Pathname);
760
			goto errxit;
760
			goto errxit;
761
		} else if ( bytes != n ) {
761
		} else if ( bytes != n ) {
762
			if ( bytes > 0 )
762
			if ( bytes > 0 )
763
				bytes_written += bytes;
763
				bytes_written += bytes;
764
			err("Did not write all WAV successfully",sys_errlist[errno=EIO]);
764
			err("Did not write all WAV successfully",strerror(errno=EIO));
765
			goto errxit;
765
			goto errxit;
766
		}
766
		}
767
767
(-)wavplay-1.4/locks.c (-4 / +4 lines)
Lines 125-131 Link Here
125
		 */
125
		 */
126
		if ( (ipc = semget(LockIPCKey,2,IPC_CREAT|IPC_EXCL|0666)) < 0 && errno != EEXIST ) {
126
		if ( (ipc = semget(LockIPCKey,2,IPC_CREAT|IPC_EXCL|0666)) < 0 && errno != EEXIST ) {
127
			err("Unable to create a semaphore set for key 0x%lX",
127
			err("Unable to create a semaphore set for key 0x%lX",
128
				sys_errlist[errno],
128
				strerror(errno),
129
				LockIPCKey);
129
				LockIPCKey);
130
			return -1;	/* No system IPC resources? */
130
			return -1;	/* No system IPC resources? */
131
		}
131
		}
Lines 157-163 Link Here
157
			 */
157
			 */
158
			e = errno;			/* Save error */
158
			e = errno;			/* Save error */
159
			semctl(ipc,0,IPC_RMID,NULL);	/* Destroy bad sems */
159
			semctl(ipc,0,IPC_RMID,NULL);	/* Destroy bad sems */
160
			err("%s: Unable to initialize semaphore set values",sys_errlist[errno=e]);
160
			err("%s: Unable to initialize semaphore set values",strerror(errno=e));
161
			return -1;			/* Return err ind. */
161
			return -1;			/* Return err ind. */
162
		}
162
		}
163
	}
163
	}
Lines 199-205 Link Here
199
		}
199
		}
200
200
201
	if ( s < 0 )
201
	if ( s < 0 )
202
		err("%s: Locking the %s semaphore",sys_errlist[errno],playrecx?"Record":"Play");
202
		err("%s: Locking the %s semaphore",strerror(errno),playrecx?"Record":"Play");
203
203
204
	/*
204
	/*
205
	 * Exit this procedure:
205
	 * Exit this procedure:
Lines 232-238 Link Here
232
232
233
	if ( s < 0 )
233
	if ( s < 0 )
234
		err("%s: Unlocking the %s semaphore",
234
		err("%s: Unlocking the %s semaphore",
235
			sys_errlist[errno],
235
			strerror(errno),
236
			playrecx?"Record":"Play");
236
			playrecx?"Record":"Play");
237
237
238
	return s;
238
	return s;
(-)wavplay-1.4/main.c (-8 / +8 lines)
Lines 363-369 Link Here
363
			dup2(fd,2);
363
			dup2(fd,2);
364
			close(fd);
364
			close(fd);
365
		} else	fprintf(stderr,"%s: cannot go quiet due to /dev/null\n",
365
		} else	fprintf(stderr,"%s: cannot go quiet due to /dev/null\n",
366
				sys_errlist[errno]);
366
				strerror(errno));
367
	}
367
	}
368
368
369
	/*
369
	/*
Lines 393-399 Link Here
393
	 */
393
	 */
394
	if ( wavopts.IPCKey && (wavopts.ipc = OpenDSPLocks(wavopts.IPCKey,
394
	if ( wavopts.IPCKey && (wavopts.ipc = OpenDSPLocks(wavopts.IPCKey,
395
	     !(wavopts.PlayLock.optChar | wavopts.RecdLock.optChar),v_erf)) < 0 ) {
395
	     !(wavopts.PlayLock.optChar | wavopts.RecdLock.optChar),v_erf)) < 0 ) {
396
		err("%s: Unable to get audio locking semaphores.",sys_errlist[errno]);
396
		err("%s: Unable to get audio locking semaphores.",strerror(errno));
397
		exit(1);
397
		exit(1);
398
	}
398
	}
399
399
Lines 405-411 Link Here
405
		 * Remove old semaphore set :
405
		 * Remove old semaphore set :
406
		 */
406
		 */
407
		if ( semctl(wavopts.ipc,0,IPC_RMID,NULL) < 0 ) {
407
		if ( semctl(wavopts.ipc,0,IPC_RMID,NULL) < 0 ) {
408
			err("%s: Unable to remove old locking semaphores.",sys_errlist[errno]);
408
			err("%s: Unable to remove old locking semaphores.",strerror(errno));
409
			exit(1);
409
			exit(1);
410
		}
410
		}
411
411
Lines 422-428 Link Here
422
		 * Get replacement semaphores :
422
		 * Get replacement semaphores :
423
		 */
423
		 */
424
		if ( wavopts.IPCKey && (wavopts.ipc = OpenDSPLocks(wavopts.IPCKey,0,v_erf)) < 0 ) {
424
		if ( wavopts.IPCKey && (wavopts.ipc = OpenDSPLocks(wavopts.IPCKey,0,v_erf)) < 0 ) {
425
			err("%s: Unable to get audio locking semaphores.",sys_errlist[errno]);
425
			err("%s: Unable to get audio locking semaphores.",strerror(errno));
426
			exit(1);
426
			exit(1);
427
		}
427
		}
428
	}
428
	}
Lines 431-437 Link Here
431
	 * -u play unlock request :
431
	 * -u play unlock request :
432
	 */
432
	 */
433
	if ( wavopts.PlayLock.optChar == OPF_PLAY_UNLOCK && UnlockDSP(wavopts.ipc,0,v_erf) ) {
433
	if ( wavopts.PlayLock.optChar == OPF_PLAY_UNLOCK && UnlockDSP(wavopts.ipc,0,v_erf) ) {
434
		err("%s: -%c unlock request failed.",sys_errlist[errno],OPF_PLAY_UNLOCK);
434
		err("%s: -%c unlock request failed.",strerror(errno),OPF_PLAY_UNLOCK);
435
		exit(1);
435
		exit(1);
436
	}
436
	}
437
437
Lines 439-445 Link Here
439
	 * -U record unlock request :
439
	 * -U record unlock request :
440
	 */
440
	 */
441
	if ( wavopts.RecdLock.optChar == OPF_RECD_UNLOCK && UnlockDSP(wavopts.ipc,1,v_erf) ) {
441
	if ( wavopts.RecdLock.optChar == OPF_RECD_UNLOCK && UnlockDSP(wavopts.ipc,1,v_erf) ) {
442
		err("%s: -%c unlock request failed.",sys_errlist[errno],OPF_RECD_UNLOCK);
442
		err("%s: -%c unlock request failed.",strerror(errno),OPF_RECD_UNLOCK);
443
		exit(1);
443
		exit(1);
444
	}
444
	}
445
445
Lines 447-453 Link Here
447
	 * -l play lock request :
447
	 * -l play lock request :
448
	 */
448
	 */
449
	if ( wavopts.PlayLock.optChar == OPF_PLAY_LOCK && LockDSP(wavopts.ipc,0,v_erf,0) ) {
449
	if ( wavopts.PlayLock.optChar == OPF_PLAY_LOCK && LockDSP(wavopts.ipc,0,v_erf,0) ) {
450
		err("%s: -%c lock request failed.",sys_errlist[errno],OPF_PLAY_LOCK);
450
		err("%s: -%c lock request failed.",strerror(errno),OPF_PLAY_LOCK);
451
		exit(1);
451
		exit(1);
452
	}
452
	}
453
453
Lines 455-461 Link Here
455
	 * -L record lock request :
455
	 * -L record lock request :
456
	 */
456
	 */
457
	if ( wavopts.RecdLock.optChar == OPF_RECD_LOCK && LockDSP(wavopts.ipc,1,v_erf,0) ) {
457
	if ( wavopts.RecdLock.optChar == OPF_RECD_LOCK && LockDSP(wavopts.ipc,1,v_erf,0) ) {
458
		err("%s: -%c lock request failed.",sys_errlist[errno],OPF_RECD_LOCK);
458
		err("%s: -%c lock request failed.",strerror(errno),OPF_RECD_LOCK);
459
		exit(1);
459
		exit(1);
460
	}
460
	}
461
461
(-)wavplay-1.4/save_as.c (-8 / +8 lines)
Lines 81-87 Link Here
81
	if ( stat(RECORD_PATH,&src_stat) != 0 ) {
81
	if ( stat(RECORD_PATH,&src_stat) != 0 ) {
82
		if ( errno == ENOENT )
82
		if ( errno == ENOENT )
83
			ReportErrorf("No file %s to 'save'.",RECORD_PATH);
83
			ReportErrorf("No file %s to 'save'.",RECORD_PATH);
84
		else	ReportErrorf("%s: doing stat on recorded.wav",sys_errlist[errno]);
84
		else	ReportErrorf("%s: doing stat on recorded.wav",strerror(errno));
85
		return;
85
		return;
86
	}
86
	}
87
87
Lines 139-167 Link Here
139
	if ( !bCopy ) {
139
	if ( !bCopy ) {
140
		if ( link(RECORD_PATH,path) == 0 ) {		/* mv by linking.. */
140
		if ( link(RECORD_PATH,path) == 0 ) {		/* mv by linking.. */
141
			if ( unlink(RECORD_PATH) != 0 )		/* And removing the old */
141
			if ( unlink(RECORD_PATH) != 0 )		/* And removing the old */
142
				ReportErrorf("%s: unlink(%s)",sys_errlist[errno]);
142
				ReportErrorf("%s: unlink(%s)",strerror(errno));
143
			goto rm;				/* Success (or mostly success) */
143
			goto rm;				/* Success (or mostly success) */
144
		} else	ReportErrorf("%s: link(%s,%s)\nWill try a copy next..",
144
		} else	ReportErrorf("%s: link(%s,%s)\nWill try a copy next..",
145
				sys_errlist[errno],RECORD_PATH,path);
145
				strerror(errno),RECORD_PATH,path);
146
	}
146
	}
147
147
148
	/*
148
	/*
149
	 * Copy the file, if control passes to here:
149
	 * Copy the file, if control passes to here:
150
	 */
150
	 */
151
	if ( (ifd = open(RECORD_PATH,O_RDONLY,0)) < 0 ) {
151
	if ( (ifd = open(RECORD_PATH,O_RDONLY,0)) < 0 ) {
152
		ReportErrorf("%s: opening %s for read.",sys_errlist[errno],RECORD_PATH);
152
		ReportErrorf("%s: opening %s for read.",strerror(errno),RECORD_PATH);
153
		goto xit;
153
		goto xit;
154
	}
154
	}
155
155
156
	if ( (ofd = open(path,O_WRONLY|O_CREAT|O_TRUNC,0644)) < 0 ) {
156
	if ( (ofd = open(path,O_WRONLY|O_CREAT|O_TRUNC,0644)) < 0 ) {
157
		ReportErrorf("%s: opening %s for read.",sys_errlist[errno],path);
157
		ReportErrorf("%s: opening %s for read.",strerror(errno),path);
158
		close(ifd);
158
		close(ifd);
159
		goto xit;
159
		goto xit;
160
	}
160
	}
161
161
162
	while ( (n = read(ifd,buf,sizeof buf)) > 0 )
162
	while ( (n = read(ifd,buf,sizeof buf)) > 0 )
163
		if ( write(ofd,buf,n) < 0 ) {
163
		if ( write(ofd,buf,n) < 0 ) {
164
			ReportErrorf("%s: writing file %s for copy.",sys_errlist[errno],path);
164
			ReportErrorf("%s: writing file %s for copy.",strerror(errno),path);
165
			close(ifd);
165
			close(ifd);
166
			close(ofd);
166
			close(ofd);
167
			unlink(path);
167
			unlink(path);
Lines 169-175 Link Here
169
		}
169
		}
170
170
171
	if ( n < 0 ) {
171
	if ( n < 0 ) {
172
		ReportErrorf("%s: reading file %s for copy.",sys_errlist[errno],RECORD_PATH);
172
		ReportErrorf("%s: reading file %s for copy.",strerror(errno),RECORD_PATH);
173
		close(ifd);
173
		close(ifd);
174
		close(ofd);
174
		close(ofd);
175
		unlink(path);
175
		unlink(path);
Lines 177-183 Link Here
177
	}
177
	}
178
178
179
	if ( fsync(ofd) != 0 )
179
	if ( fsync(ofd) != 0 )
180
		ReportErrorf("%s: fsync(%s)",sys_errlist[errno],path);
180
		ReportErrorf("%s: fsync(%s)",strerror(errno),path);
181
	if ( close(ofd) == 0 )
181
	if ( close(ofd) == 0 )
182
		unlink(RECORD_PATH);		/* Delete recorded.wav if copy successful */
182
		unlink(RECORD_PATH);		/* Delete recorded.wav if copy successful */
183
	close(ifd);
183
	close(ifd);
(-)wavplay-1.4/server.c (-8 / +12 lines)
Lines 326-332 Link Here
326
		/*
326
		/*
327
		 * Tell client the pathname we're using for the recording:
327
		 * Tell client the pathname we're using for the recording:
328
		 */
328
		 */
329
		strcpy(svr.path,RECORD_PATH);		/* Always record to same place */
329
		if(strlen(RECORD_PATH) >= sizeof(svr.path)-1) {
330
			fprintf(stderr, "Record path %s too long. Truncating.\n", RECORD_PATH);
331
		}
332
		strncpy(svr.path,RECORD_PATH, sizeof(svr.path)-1);		/* Always record to same place */
333
		svr.path[sizeof(svr.path)-1]=0;
330
334
331
		msg.msg_type = ToClnt_Path;
335
		msg.msg_type = ToClnt_Path;
332
		strcpy(msg.u.toclnt_path.path,svr.path);
336
		strcpy(msg.u.toclnt_path.path,svr.path);
Lines 397-403 Link Here
397
		 * Remove old semaphore set :
401
		 * Remove old semaphore set :
398
		 */
402
		 */
399
		if ( semctl(svr.lockIPCID,0,IPC_RMID,NULL) < 0 ) {
403
		if ( semctl(svr.lockIPCID,0,IPC_RMID,NULL) < 0 ) {
400
			toclnt_fatal(0,"%s: Unable to remove old locking semaphores.",sys_errlist[errno]);
404
			toclnt_fatal(0,"%s: Unable to remove old locking semaphores.",strerror(errno));
401
			exit(13);
405
			exit(13);
402
		}
406
		}
403
407
Lines 406-412 Link Here
406
		 */
410
		 */
407
		if ( (svr.lockIPCID = OpenDSPLocks(svr.IPCKey,1,x_erf)) < 0 ) {
411
		if ( (svr.lockIPCID = OpenDSPLocks(svr.IPCKey,1,x_erf)) < 0 ) {
408
			toclnt_fatal(0,"%s:\nAttempting to obtain new locking\nsemaphores.",
412
			toclnt_fatal(0,"%s:\nAttempting to obtain new locking\nsemaphores.",
409
				sys_errlist[errno]);
413
				strerror(errno));
410
			exit(13);
414
			exit(13);
411
		}
415
		}
412
416
Lines 497-503 Link Here
497
		if ( sched_setscheduler(pid,SCHED_FIFO,&rtp) != 0 ) {
501
		if ( sched_setscheduler(pid,SCHED_FIFO,&rtp) != 0 ) {
498
			z = errno;
502
			z = errno;
499
			fprintf(stderr,"WARNING; %s: sched_setscheduler(%ld,SCHED_FIFO,) // priority=%d;\n",
503
			fprintf(stderr,"WARNING; %s: sched_setscheduler(%ld,SCHED_FIFO,) // priority=%d;\n",
500
				sys_errlist[z],(long)pid,(int)SCHED_PRIORITY);
504
				strerror(z),(long)pid,(int)SCHED_PRIORITY);
501
			if ( z == EPERM && rtp.sched_priority > 0 )
505
			if ( z == EPERM && rtp.sched_priority > 0 )
502
				fputs("You need setuid root to use sched_setscheduler()\n",stderr);
506
				fputs("You need setuid root to use sched_setscheduler()\n",stderr);
503
			fflush(stderr);
507
			fflush(stderr);
Lines 531-537 Link Here
531
	msg.bytes = 0;
535
	msg.bytes = 0;
532
536
533
	if ( MsgToClient(clntIPC,&msg,flags) != 0 ) {	/* Send to client */
537
	if ( MsgToClient(clntIPC,&msg,flags) != 0 ) {	/* Send to client */
534
		ClntMsg("%s: toclnt_ready(flags=0%o;ipc=%d)\n",sys_errlist[errno],flags,clntIPC);
538
		ClntMsg("%s: toclnt_ready(flags=0%o;ipc=%d)\n",strerror(errno),flags,clntIPC);
535
		exit(13);
539
		exit(13);
536
	}
540
	}
537
}
541
}
Lines 550-556 Link Here
550
	msg.u.toclnt_bits.DataBits = bits;
554
	msg.u.toclnt_bits.DataBits = bits;
551
555
552
	if ( MsgToClient(clntIPC,&msg,flags) != 0 ) {	/* Send to client */
556
	if ( MsgToClient(clntIPC,&msg,flags) != 0 ) {	/* Send to client */
553
		ClntMsg("%s: toclnt_ready(flags=0%o;ipc=%d)\n",sys_errlist[errno],flags,clntIPC);
557
		ClntMsg("%s: toclnt_ready(flags=0%o;ipc=%d)\n",strerror(errno),flags,clntIPC);
554
		exit(13);
558
		exit(13);
555
	}
559
	}
556
}
560
}
Lines 602-608 Link Here
602
	msg.bytes = sizeof msg.u.toclnt_settings;
606
	msg.bytes = sizeof msg.u.toclnt_settings;
603
607
604
	if ( (z = MsgToClient(clntIPC,&msg,flags)) != 0 && flags && errno != EAGAIN ) {
608
	if ( (z = MsgToClient(clntIPC,&msg,flags)) != 0 && flags && errno != EAGAIN ) {
605
		toclnt_fatal(0,"%s: toclnt_settings(flags=0%o;ipc=%d)\n",sys_errlist[errno],flags,clntIPC);
609
		toclnt_fatal(0,"%s: toclnt_settings(flags=0%o;ipc=%d)\n",strerror(errno),flags,clntIPC);
606
		exit(13);
610
		exit(13);
607
	}
611
	}
608
612
Lines 645-651 Link Here
645
		[sizeof msg.u.toclnt_errmsg.msg - 1] = 0;
649
		[sizeof msg.u.toclnt_errmsg.msg - 1] = 0;
646
650
647
	if ( MsgToClient(clntIPC,&msg,flags) != 0 ) {	/* Send to client */
651
	if ( MsgToClient(clntIPC,&msg,flags) != 0 ) {	/* Send to client */
648
		fprintf(stderr,"%s: toclnt_errmsg(...)\n",sys_errlist[errno]);
652
		fprintf(stderr,"%s: toclnt_errmsg(...)\n",strerror(errno));
649
		exit(13);
653
		exit(13);
650
	}
654
	}
651
}
655
}
(-)wavplay-1.4/wavfile.c (-2 / +2 lines)
Lines 141-147 Link Here
141
	waveheader.nDataBytes      = databytes;
141
	waveheader.nDataBytes      = databytes;
142
142
143
	if (write (wavefile, &waveheader, sizeof (WAVE_HEADER)) != sizeof (WAVE_HEADER)) {
143
	if (write (wavefile, &waveheader, sizeof (WAVE_HEADER)) != sizeof (WAVE_HEADER)) {
144
		err("%s",sys_errlist[errno]);	/* wwg: report the error */
144
		err("%s",strerror(errno));	/* wwg: report the error */
145
		return  WW_BADWRITEHEADER ;
145
		return  WW_BADWRITEHEADER ;
146
	}
146
	}
147
147
Lines 157-163 Link Here
157
	v_erf = erf;					/* wwg: Set error reporting function */
157
	v_erf = erf;					/* wwg: Set error reporting function */
158
158
159
	if (lseek (wavefile, 0L, SEEK_SET)) {
159
	if (lseek (wavefile, 0L, SEEK_SET)) {
160
		err("%s",sys_errlist[errno]);		/* wwg: Report error */
160
		err("%s",strerror(errno));		/* wwg: Report error */
161
		return  WR_BADSEEK ;
161
		return  WR_BADSEEK ;
162
	}
162
	}
163
163

Return to bug 660