d7260847a5
Submitted by maintainer Ian McWilliam <i.mcwilliam@uws.edu.au>.
95 lines
1.9 KiB
Plaintext
95 lines
1.9 KiB
Plaintext
--- etc/psf/psf.c.orig Fri Oct 9 00:45:56 1998
|
|
+++ etc/psf/psf.c Mon Nov 8 12:46:09 1999
|
|
@@ -26,6 +26,9 @@
|
|
#include <sys/syslog.h>
|
|
#include <atalk/paths.h>
|
|
#include <stdio.h>
|
|
+#include <unistd.h>
|
|
+#include <stdlib.h>
|
|
+#include <string.h>
|
|
#include <strings.h>
|
|
#include <ctype.h>
|
|
#include <signal.h>
|
|
@@ -33,6 +36,8 @@
|
|
char psapath[] = _PATH_PSA;
|
|
char *psaargv[] = { "psa", 0, 0, 0, 0 };
|
|
|
|
+int copyio(), pexecv(), textps();
|
|
+
|
|
/*
|
|
* If we're not doing accounting, we just call pap as below.
|
|
* If we are doing accounting, we call pap twice. The first time,
|
|
@@ -68,11 +73,12 @@
|
|
{ 80, 70, 8.27, 11.69 }, /* A4 */
|
|
};
|
|
|
|
+int
|
|
main( ac, av )
|
|
int ac;
|
|
char **av;
|
|
{
|
|
- int c, rc, i, children = 0;
|
|
+ int c, rc, children = 0;
|
|
#ifdef FUCKED
|
|
int psafileno, multiconn = 0, waitidle = 0, waitidle2 = 0;
|
|
#endif FUCKED
|
|
@@ -81,7 +87,7 @@
|
|
extern int optind, opterr;
|
|
|
|
opterr = 0;
|
|
- if (( prog = rindex( av[ 0 ], '/' )) == NULL ) {
|
|
+ if (( prog = strrchr( av[ 0 ], '/' )) == NULL ) {
|
|
prog = av[ 0 ];
|
|
} else {
|
|
prog++;
|
|
@@ -146,13 +152,13 @@
|
|
exit( 2 );
|
|
}
|
|
#ifdef FUCKED
|
|
- if ( index( prog, 'w' )) {
|
|
+ if ( strchr( prog, 'w' )) {
|
|
waitidle++;
|
|
}
|
|
- if ( index( prog, 'W' )) {
|
|
+ if ( strchr( prog, 'W' )) {
|
|
waitidle2++;
|
|
}
|
|
- if ( index( prog, 'm' )) {
|
|
+ if ( strchr( prog, 'm' )) {
|
|
multiconn++;
|
|
}
|
|
#endif FUCKED
|
|
@@ -345,6 +351,7 @@
|
|
exit( rc );
|
|
}
|
|
|
|
+int
|
|
copyio()
|
|
{
|
|
/* implement the FSM needed to do the suspend. Note that
|
|
@@ -355,7 +362,7 @@
|
|
*/
|
|
struct timeval tv;
|
|
fd_set fdset;
|
|
- int ctl = 0, i;
|
|
+ int ctl = 0;
|
|
|
|
notdone:
|
|
do {
|
|
@@ -459,6 +466,7 @@
|
|
/EP { SV restore showpage } bind def\n\
|
|
%%EndProlog\n";
|
|
|
|
+int
|
|
textps()
|
|
{
|
|
struct papersize papersize;
|
|
@@ -653,6 +661,7 @@
|
|
* Manipulates file descriptors 0, 1, and 2, such that the new child
|
|
* is reading from the parent's output.
|
|
*/
|
|
+int
|
|
pexecv( path, argv )
|
|
char *path, *argv[];
|
|
{
|