mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-13 16:38:14 +00:00
* timer.c (main): Set the ownership of the stdin file descriptor
to the current process. Print error messages if either of the fcntl's fails. * timer.c (sigcatch): Declare this to return SIGTYPE (defined in ../src/config.h), not void.
This commit is contained in:
parent
5d13f393f9
commit
b183949171
@ -213,7 +213,7 @@ getevent ()
|
||||
notify ();
|
||||
}
|
||||
|
||||
void
|
||||
SIGTYPE
|
||||
sigcatch (sig)
|
||||
int sig;
|
||||
/* dispatch on incoming signal, then restore it */
|
||||
@ -262,7 +262,18 @@ main (argc, argv)
|
||||
signal (SIGTERM, sigcatch);
|
||||
|
||||
#ifndef USG
|
||||
fcntl (0, F_SETFL, FASYNC);
|
||||
if (fcntl (0, F_SETOWN, getpid ()) == -1)
|
||||
{
|
||||
fprintf (stderr, "%s: can't set ownership of stdin\n", pname);
|
||||
fprintf (stderr, "%s\n", sys_errlist[errno]);
|
||||
exit (1);
|
||||
}
|
||||
if (fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) | FASYNC) == -1)
|
||||
{
|
||||
fprintf (stderr, "%s: can't request asynchronous I/O on stdin\n", pname);
|
||||
fprintf (stderr, "%s\n", sys_errlist[errno]);
|
||||
exit (1);
|
||||
}
|
||||
#endif /* USG */
|
||||
|
||||
while (1) pause ();
|
||||
|
Loading…
Reference in New Issue
Block a user