~ubuntu-branches/ubuntu/maverick/mosh/maverick-backports

« back to all changes in this revision

Viewing changes to third/libstddjb/selfpipe_internal.c

  • Committer: Package Import Robot
  • Author(s): Keith Winstein
  • Date: 2012-03-12 04:51:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120312045143-0pib9hs84wiauznl
Tags: 1.0-1
* Version 1.0 released.

* mosh now supports --version option and prints no-warranty message.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ISC license. */
 
2
 
 
3
/* MT-unsafe */
 
4
 
 
5
#include <signal.h>
 
6
#include "sysdeps.h"
 
7
#include "selfpipe-internal.h"
 
8
 
 
9
sigset_t selfpipe_caught ;
 
10
 
 
11
#ifdef HASSIGNALFD
 
12
 
 
13
int selfpipe_fd = -1 ;
 
14
 
 
15
#else
 
16
 
 
17
#include <errno.h>
 
18
#include "allreadwrite.h"
 
19
#include "djbunix.h"
 
20
 
 
21
int selfpipe[2] = { -1, -1 } ;
 
22
 
 
23
static void selfpipe_trigger (int s)
 
24
{
 
25
  char c = (char)s ;
 
26
  fd_write(selfpipe[1], &c, 1) ;
 
27
}
 
28
 
 
29
struct skasigaction const selfpipe_ssa = { &selfpipe_trigger, SKASA_NOCLDSTOP | SKASA_MASKALL } ;
 
30
 
 
31
#endif