#include <setjmp.h>
#include <h/tws.h>
#include <h/mts.h>
+#include "h/done.h"
#include <h/utils.h>
-#include "../sbr/lock_file.h"
-#include "../sbr/m_mktemp.h"
+#include "sbr/lock_file.h"
+#include "sbr/m_mktemp.h"
#include <pwd.h>
#include <sys/ioctl.h>
static int parse (int);
static void expand (char *, char *, int);
static void glob (int);
-static struct pair *lookup (struct pair *, char *);
+static struct pair *lookup (struct pair *, char *) PURE;
static int logged_in (void);
static int timely (char *, char *);
static int usr_file (int, char *, int);
}
fclose (fp);
- return (won ? 0 : -1);
+ return won ? 0 : -1;
}
if (debug)
continue;
endutxent();
- return (utmped = DONE);
+ return utmped = DONE;
}
}
endutxent();
#endif /* HAVE_GETUTXENT */
- return (utmped = NOTOK);
+ return utmped = NOTOK;
}
#define check(t,a,b) if (t < a || t > b) return -1
{
volatile int fd = fd_arg;
pid_t child_id;
- int i, bytes, seconds, status;
+ int bytes, seconds, status;
struct stat st;
if (verbose && !suppress)
lseek(fd, 0, SEEK_SET);
- for (i = 0; (child_id = fork()) == -1 && i < 5; i++)
- sleep (5);
-
+ child_id = fork();
switch (child_id) {
case -1:
/* fork error */
}
#endif /* TIOCNOTTY */
- setpgid ((pid_t) 0, getpid ()); /* put in own process group */
+ setpgid(0, getpid()); /* put in own process group */
*environ = NULL;
setenv("USER", pw->pw_name, 1);
setenv("SHELL", pw->pw_shell, 1);
execvp (pgm, vec);
- _exit (-1);
+ _exit(1);
default:
/* parent process */
else
pidstatus (status, stdout, ", failed");
}
- return (status == 0 ? 0 : -1);
+ return status == 0 ? 0 : -1;
}
/*
* Ruthlessly kill the child and anything
static char *
trim (char *cp)
{
- char buffer[BUFSIZ*4];
+ static char buffer[BUFSIZ * 4];
char *bp, *sp;
if (cp == NULL)
if (isspace((unsigned char) *sp))
*sp = ' ';
- /* now return a copy */
- return mh_xstrdup(bp);
+ return bp;
}
/*