projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ftp://netsw.org/x11/tools/desktop/xscreensaver-4.07.tar.gz
[xscreensaver]
/
driver
/
subprocs.c
diff --git
a/driver/subprocs.c
b/driver/subprocs.c
index 62ae9ae9040281054a50711acfd5b0c5ae395a04..b6948e8789c30dd8c8c025f79eeafa1d7a568c27 100644
(file)
--- a/
driver/subprocs.c
+++ b/
driver/subprocs.c
@@
-1,5
+1,5
@@
/* subprocs.c --- choosing, spawning, and killing screenhacks.
/* subprocs.c --- choosing, spawning, and killing screenhacks.
- * xscreensaver, Copyright (c) 1991-200
1
Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-200
3
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
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@
-365,12
+365,12
@@
kill_job (saver_info *si, pid_t pid, int signal)
if (errno == ESRCH)
fprintf (stderr,
"%s: %d: child process %lu (%s) was already dead.\n",
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)",
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);
}
}
perror (buf);
}
}
@@
-661,6
+661,11
@@
spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p)
/* No hacks at all */
new_hack = -1;
}
/* 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. */
else if (si->selection_mode == -1)
{
/* Select the next hack, wrapping. */
@@
-732,8
+737,8
@@
spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p)
*/
if (p->verbose_p)
fprintf(stderr,
*/
if (p->verbose_p)
fprintf(stderr,
-
"%s: no suitable visuals for these program
s.\n",
- blurb());
+
"%s: %d: no programs enabled, or no suitable visual
s.\n",
+ blurb()
, ssi->number
);
return;
}
else
return;
}
else
@@
-765,8
+770,13
@@
spawn_screenhack_1 (saver_screen_info *ssi, Bool first_time_p)
(unsigned long) getpid ());
exec_command (p->shell, hack->command, p->nice_inferior);
(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;
exit (1); /* exits child fork */
break;
@@
-885,6
+895,11
@@
hack_environment (saver_info *si)
if (putenv (npath))
abort ();
if (putenv (npath))
abort ();
+
+ /* don't free (npath) -- some implementations of putenv (BSD 4.4,
+ glibc 2.0) copy the argument, but some (libc4,5, glibc 2.1.2)
+ do not. So we must leak it (and/or the previous setting). Yay.
+ */
}
#endif /* HAVE_PUTENV && DEFAULT_PATH_PREFIX */
}
}
#endif /* HAVE_PUTENV && DEFAULT_PATH_PREFIX */
}
@@
-923,6
+938,7
@@
hack_subproc_environment (saver_screen_info *ssi)
#ifdef HAVE_PUTENV
if (putenv (ndpy))
abort ();
#ifdef HAVE_PUTENV
if (putenv (ndpy))
abort ();
+ /* do not free(ndpy) -- see above. */
#endif /* HAVE_PUTENV */
}
#endif /* HAVE_PUTENV */
}
@@
-1005,14
+1021,23
@@
get_best_gl_visual (saver_screen_info *ssi)
/* Wait for the child to die. */
waitpid (-1, &wait_status, 0);
/* 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%
l
x %c", &v, &c))
result = (int) v;
if (result == 0)
{
if (si->prefs.verbose_p)
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
return 0;
}
else