Deleted Added
full compact
35c35
< "$FreeBSD: head/sbin/dump/tape.c 128073 2004-04-09 19:58:40Z markm $";
---
> "$FreeBSD: head/sbin/dump/tape.c 128175 2004-04-13 02:58:06Z green $";
69a70
> FILE *popenfp = NULL;
338a340,345
> if (popenout) {
> tapefd = -1;
> (void)pclose(popenfp);
> popenfp = NULL;
> return;
> }
503d509
< int waitpid;
533,535c539,541
< while ((waitpid = wait(&status)) != childpid)
< msg("Parent %d waiting for child %d has another child %d return\n",
< parentpid, childpid, waitpid);
---
> if (waitpid(childpid, &status, 0) == -1)
> msg("Waiting for child %d: %s\n", childpid,
> strerror(errno));
591a598,615
> if (pipeout) {
> tapefd = STDOUT_FILENO;
> } else if (popenout) {
> char volno[sizeof("2147483647")];
>
> (void)sprintf(volno, "%d", spcl.c_volume + 1);
> if (setenv("DUMP_VOLUME", volno, 1) == -1) {
> msg("Cannot set $DUMP_VOLUME.\n");
> dumpabort(0);
> }
> popenfp = popen(popenout, "w");
> if (popenfp == NULL) {
> msg("Cannot open output pipeline \"%s\".\n",
> popenout);
> dumpabort(0);
> }
> tapefd = fileno(popenfp);
> } else {
593,594c617,618
< while ((tapefd = (host ? rmtopen(tape, 2) :
< pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
---
> while ((tapefd = (host ? rmtopen(tape, 2) :
> open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
596,597c620,621
< while ((tapefd = (pipeout ? 1 :
< open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
---
> while ((tapefd =
> open(tape, O_WRONLY|O_CREAT, 0666)) < 0)
599,602c623,627
< {
< msg("Cannot open output \"%s\".\n", tape);
< if (!query("Do you want to retry the open?"))
< dumpabort(0);
---
> {
> msg("Cannot open output \"%s\".\n", tape);
> if (!query("Do you want to retry the open?"))
> dumpabort(0);
> }
605a631,632
> if (popenout)
> close(tapefd); /* Give up our copy of it. */