/* subprocs.c --- choosing, spawning, and killing screenhacks.
- * xscreensaver, Copyright (c) 1991-2001 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2003 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
static void
limit_subproc_memory (int address_space_limit, Bool verbose_p)
{
+
+/* This has caused way more problems than it has solved...
+ Let's just completely ignore the "memoryLimit" option now.
+ */
+#undef HAVE_SETRLIMIT
+
#if defined(HAVE_SETRLIMIT) && defined(RLIMIT_AS)
struct rlimit r;
if (errno == ESRCH)
fprintf (stderr,
"%s: %d: child process %lu (%s) was already dead.\n",
- blurb(), job->screen, job->pid, job->name);
+ blurb(), job->screen, (unsigned long) job->pid, job->name);
else
{
char buf [1024];
sprintf (buf, "%s: %d: couldn't kill child process %lu (%s)",
- blurb(), job->screen, job->pid, job->name);
+ blurb(), job->screen, (unsigned long) job->pid, job->name);
perror (buf);
}
}
/* No hacks at all */
new_hack = -1;
}
+ else if (p->screenhacks_count == 1)
+ {
+ /* Exactly one hack in the list */
+ new_hack = 0;
+ }
else if (si->selection_mode == -1)
{
/* Select the next hack, wrapping. */
(unsigned long) getpid ());
exec_command (p->shell, hack->command, p->nice_inferior);
- /* If that returned, we were unable to exec the subprocess. */
- print_path_error (hack->command);
+
+ /* If that returned, we were unable to exec the subprocess.
+ Print an error message, if desired.
+ */
+ if (! p->ignore_uninstalled_p)
+ print_path_error (hack->command);
+
exit (1); /* exits child fork */
break;
/* Wait for the child to die. */
waitpid (-1, &wait_status, 0);
- if (1 == sscanf (buf, "0x%x %c", &v, &c))
+ if (1 == sscanf (buf, "0x%lx %c", &v, &c))
result = (int) v;
if (result == 0)
{
if (si->prefs.verbose_p)
- fprintf (stderr, "%s: %s did not report a GL visual!\n",
- blurb(), av[0]);
+ {
+ int L = strlen(buf);
+ fprintf (stderr, "%s: %s did not report a GL visual!\n",
+ blurb(), av[0]);
+
+ if (L && buf[L-1] == '\n')
+ buf[--L] = 0;
+ if (*buf)
+ fprintf (stderr, "%s: %s said: \"%s\"\n",
+ blurb(), av[0], buf);
+ }
return 0;
}
else