Deleted Added
full compact
4c4
< *
---
> *
21c21
< *
---
> *
33,34c33,34
< *
< * $FreeBSD: head/usr.sbin/fwcontrol/fwdv.c 113584 2003-04-17 03:38:03Z simokawa $
---
> *
> * $FreeBSD: head/usr.sbin/fwcontrol/fwdv.c 163712 2006-10-26 22:33:38Z imp $
52a53
> #include <sysexits.h>
56a58,59
> #include "fwmethods.h"
>
61c64
< int n,d;
---
> int n,d;
91,92c94,95
< int
< dvrecv(int d, char *filename, char ich, int count)
---
> void
> dvrecv(int d, const char *filename, char ich, int count)
105,107c108,116
< fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
< buf = (char *)malloc(RBUFSIZE);
< pad = (char *)malloc(DSIZE*MAXBLOCKS);
---
> if(strcmp(filename, "-") == 0) {
> fd = STDOUT_FILENO;
> } else {
> fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0660);
> if (fd == -1)
> err(EX_NOINPUT, filename);
> }
> buf = malloc(RBUFSIZE);
> pad = malloc(DSIZE*MAXBLOCKS);
117,119c126,127
< if (ioctl(d, FW_SSTBUF, &bufreq) < 0) {
< err(1, "ioctl");
< }
---
> if (ioctl(d, FW_SSTBUF, &bufreq) < 0)
> err(1, "ioctl FW_SSTBUF");
124c132
< if( ioctl(d, FW_SRSTREAM, &isoreq) < 0)
---
> if (ioctl(d, FW_SRSTREAM, &isoreq) < 0)
150c158
< fprintf(stderr, "(EAGAIN)\n");
---
> fprintf(stderr, "(EAGAIN) - push 'Play'?\n");
161c169
< pkt = (struct fw_pkt *) ptr;
---
> pkt = (struct fw_pkt *) ptr;
189c197
< printf("%s\n", system_name[system]);
---
> fprintf(stderr, "%s\n", system_name[system]);
240c248,250
< close(fd);
---
> if(fd != STDOUT_FILENO) {
> close(fd);
> }
242d251
< return 0;
246,247c255,256
< int
< dvsend(int d, char *filename, char ich, int count)
---
> void
> dvsend(int d, const char *filename, char ich, int count)
254c263
< int system=-1, pad_acc, cycle_acc, cycle, f_cycle, f_frac;
---
> int system=-1, pad_acc, cycle_acc, cycle, f_cycle, f_frac;
263c272,275
< pbuf = (char *)malloc(DSIZE * TNBUF);
---
> if (fd == -1)
> err(EX_NOINPUT, filename);
>
> pbuf = malloc(DSIZE * TNBUF);
272,274c284,285
< if (ioctl(d, FW_SSTBUF, &bufreq) < 0) {
< err(1, "ioctl");
< }
---
> if (ioctl(d, FW_SSTBUF, &bufreq) < 0)
> err(1, "ioctl FW_SSTBUF");
279,280c290,291
< if( ioctl(d, FW_STSTREAM, &isoreq) < 0)
< err(1, "ioctl");
---
> if (ioctl(d, FW_STSTREAM, &isoreq) < 0)
> err(1, "ioctl FW_STSTREAM");
301c312
< for (i = 1; i < TNBUF; i++) {
---
> for (i = 1; i < TNBUF; i++)
303d313
< }
323c333
< printf("\nend of file\n");
---
> fprintf(stderr, "\nend of file\n");
394,395c404
< fprintf(stderr, "(EAGAIN)\n");
< fflush(stderr);
---
> fprintf(stderr, "(EAGAIN) - push 'Play'?\n");
405c414
< rtime = end.tv_sec - start.tv_sec
---
> rtime = end.tv_sec - start.tv_sec
409d417
< return 0;