Mercurial > hg > xemacs-beta
annotate tests/sigpipe.c @ 4502:8748a3f7ceb4
Handle varalias chains, custom variables in #'user-variable-p.
src/ChangeLog addition:
2008-08-23 Aidan Kehoe <kehoea@parhasard.net>
* eval.c (Fuser_variable_p): Moved to symbols.c
* symbols.c (Fcustom_variable_p): Moved here from custom.el.
(user_variable_alias_check_fun): Mapper function used in
`user-variable-p'.
(Fuser_variable_p): Moved here from eval.c, to allow it to examine
the variable alias chain. Expanded to check each entry in the
variable alias chain for signs of being a user variable;
documentation updated, noting the differences between GNU's
behaviour and ours (ours is a little more sensible)
(map_varalias_chain): New.
Given a C function, call it at least once for each symbol in a
symbol's varalias chain, signalling an error if there's a cycle,
and returning immediately if the function returns something other
than Qzero.
(Fdefvaralias): Correct the use of the word "alias" in the
docstring and in the argument name. Motivate this in a
comment. Add support for a DOCSTRING argument, something GNU has
too, and document this
* gc.c (vars_of_gc): Start the docstring of
`garbage-collection-messages' with an asterisk, to indicate that
it's a user variable.
lisp/ChangeLog addition:
2008-08-23 Aidan Kehoe <kehoea@parhasard.net>
* custom.el: Move #'custom-variable-p to C, since it's now called
from #'user-variable-p.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 23 Aug 2008 16:38:51 +0200 |
parents | 3f6adebda25c |
children | 679041362cd4 |
rev | line source |
---|---|
1231 | 1 /* code is all from loser.c and loser.el by Mly |
2 | |
3 Copyright (C) 2002 Richard Mlynarik <mly@pobox.com> | |
4 | |
5 This is part of XEmacs | |
6 | |
7 Compile this file. Run it in the background giving it a command line | |
8 argument PORT which is a positive integer 1024 < PORT < 32768 (avoid the | |
9 numbers assigned in /etc/services). | |
10 | |
11 Then start up a fresh (you're going to crash) XEmacs. Execute the following | |
12 | |
13 (defun lose (port) | |
14 (interactive "nUrk: ") | |
15 (require 'comint) | |
16 (while t | |
17 (condition-case e | |
18 (let* ((name "*lose*") | |
19 (b (get-buffer-create name))) | |
20 (switch-to-buffer b) | |
21 (comint-mode) | |
22 (comint-exec b name (cons "127.0.0.1" port) nil '()) | |
23 (process-send-string (get-buffer-process b) "\377\373\001") | |
24 (process-send-string (get-buffer-process b) "\377\373\001")) | |
25 (error (message "URK: %s" e)) (sit-for 1)))) | |
26 | |
27 Then M-x lose RET PORT RET and you lose big (in XEmacs 21.1, anyway). | |
28 Note: the error messages are proper functioning. What should eventually | |
29 happen after a number of SIGPIPEs is that you get a SIGSEGV and life is | |
30 bad and XEmacs is dead. | |
31 */ | |
32 | |
33 #include <arpa/inet.h> | |
34 | |
35 int | |
36 main (int argc, char **argv) | |
37 { | |
38 struct sockaddr_in junk; | |
39 int s; | |
40 | |
41 memset (&junk, 0, sizeof (junk)); | |
42 | |
43 junk.sin_family = AF_INET; | |
44 junk.sin_addr.s_addr = htonl (INADDR_ANY); /* un*x sucks */ | |
45 junk.sin_port = htons (atoi (argv[1])); /* un*x blows */ | |
46 | |
47 s = socket (PF_INET, SOCK_STREAM, 0); | |
48 | |
49 bind (s, (struct sockaddr *)&junk, sizeof (junk)); | |
50 | |
51 listen (s, 1); | |
52 | |
53 for (;;) | |
54 { | |
55 int loser = accept (s, NULL, 0); | |
56 close (loser); | |
57 } | |
58 } | |
59 |