Skip to content

Commit 2a2240d

Browse files
committed
Simplified code on a slide.
1 parent e4098f4 commit 2a2240d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

signals.tex

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455
\texttt{sa\_sigaction} member of the structure \texttt{sigaction} must be used
456456
for the handler, not \texttt{sa\_handler}. The new handler has three parameters
457457
and it is possible to learn the PID of a signalling process, its UID, and more.
458-
See manual page \texttt{signal.h(3HEAD)} on Solaris, the online SUS
458+
See manual page \texttt{signal.h(3HEAD)} on Linux or Solaris, the online SUS
459459
specification of the header file, or the book [POSIX.4], page
460460
\pageref{REF_PROGRAMMING}. More information is also on page \pageref{POSIX} and
461461
\pageref{SIGWAITINFO}. Examples: \example{sig\-nals/siginfo.c},
@@ -574,15 +574,14 @@
574574
\sltitle{Example: blocking signals}
575575
\setlength{\baselineskip}{0.8\baselineskip}
576576
\begin{alltt}
577-
sigset\_t sigs, osigs; struct sigaction sa;
577+
sigset\_t sigs, osigs; struct sigaction sa = \{ 0 \};
578578
sigfillset(&sigs); \emprg{sigprocmask}(SIG\_BLOCK, &sigs, &osigs);
579579
switch(cpid = fork()) \{
580580
case -1:
581581
\emprg{sigprocmask}(SIG\_SETMASK, &osigs, NULL);
582582
...
583583
case 0: /* Child */
584-
sa.sa\_handler = h\_cld; sigemptyset(&sa.sa\_mask);
585-
sa.sa\_flags = 0;
584+
sa.sa\_handler = h\_cld;
586585
\emprg{sigaction}(SIGINT, &sa, NULL);
587586
\emprg{sigprocmask}(SIG\_SETMASK, &osigs, NULL);
588587
...
@@ -602,7 +601,7 @@
602601
signal mask, see page \pageref{FORK}.
603602
\item Out of simplicity we block all the signals in the example even that on
604603
pages \pageref{SPECIALSIGNALS} and \pageref{THREADS_SIGWAIT} it is explained why
605-
it is not a good thing.
604+
it is not a good idea.
606605
\end{itemize}
607606

608607
%%%%%

0 commit comments

Comments
 (0)