-static void
-exec_program (const char *cmd, int nice_level)
-{
- char *av[1024];
- int ac = 0;
- char *token = strtok (strdup(cmd), " \t");
- while (token)
- {
- av[ac++] = token;
- token = strtok(0, " \t");
- }
- av[ac] = 0;
-
- nice (nice_level - nice (0));
-
- usleep (250000); /* pause for 1/4th second before launching, to give the
- previous program time to die and flush its X buffer,
- so we don't get leftover turds on the window. */
-
- execvp (av[0], av); /* shouldn't return. */
-
- {
- char buf [512];
- sprintf (buf, "%s: could not execute \"%s\"", blurb(), av[0]);
- perror (buf);
- }
- fflush(stderr);
- fflush(stdout);
- exit (1); /* Note that this only exits a child fork. */
-}
-
-