Mercurial > hg > xemacs-beta
annotate tests/sigpipe.c @ 1410:44de306310b8
[xemacs-hg @ 2003-04-14 03:40:26 by youngs]
2003-04-14 Steve Youngs <youngs@xemacs.org>
* package-admin.el (package-admin-find-top-directory): Use
'directory-sep-char'.
(package-admin-get-install-dir): Ditto.
This is so PUI won't break on platforms that don't use '/' as the
directory separator.
* package-get.el (package-get-pgp-available-p): New.
(package-get-require-signed-base-updates): Use it.
(package-get-update-base-from-buffer): Move the code that finds
the gpg stuff into `package-get-pgp-available-p'.
Now if you have Mailcrypt and a PGP binary installed and set up on
your system, PUI will automatically default to doing PGP
verification, otherwise it'll default to off.
(package-get-require-base): Use the DATUM arg to `error'.
(package-get-locate-index-file): Ditto.
(package-get-update-base): Ditto.
(package-get-update-base-entries): Ditto.
(package-get-all): Ditto.
(package-get-dependencies): Ditto.
(package-get-info): Ditto.
(package-get): Ditto.
* package-info.el (batch-update-package-info): Use the DATUM arg
to `error'.
* package-net.el (package-net-batch-generate-bin-ini): Use the
DATUM arg to `error'.
* package-ui.el (pui-toggle-package-key): Use the DATUM arg to
`error'.
(pui-toggle-package-delete-key): Ditto.
(pui-install-selected-packages): Ditto.
(pui-add-required-packages): Ditto.
(pui-display-info): Ditto.
(list-packages-mode): Ditto.
* packages.el (package-require): Use the DATUM arg to `error'.
author | youngs |
---|---|
date | Mon, 14 Apr 2003 03:40:27 +0000 |
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 |