mcm (11/24/82)
I too have had problems with the line printer daemon dieing & leaving locks.
Sam Praul's (decvax!ittvax!shp) fix came close; it looks to me as if
he forgot an fclose() (see ittvax.520). Lpd.c needs another fclose in the
routine get_file(). This routine opens the spool directory, but only closes
it when all the files are printed (via an exit(0)). The last few lines of
the routine read:
ptr = top;
top = top->next;
cfree(ptr);
return(sp);
}
An 'fclose(fp);' should be inserted before the 'return(sp);' statement.
As for the console log message shp put in, We already had similar code
in place. Unfortunately, it was directed to stderr, and stderr was
closed by lpd and reopened as "/" in the first few statements.
In our version, I changed the 'open(0, "/", 2);' in lpd.c to
read 'open(0, "/dev/console", 1);'.
Mike Mitchell
decvax!duke!mcnc!ikonas!mcm