/*
* Variables definition
*/
- int i, nomask=0, testwrite=0, sigfd;
+ int i, n, nomask=0, testwrite=0, sigfd;
time_t t;
struct signalfd_siginfo siginf;
sigset_t sigmask;
die("Failing in signalfd");
printf("Signalfd armed\n");
if (testwrite) {
- if (write(sigfd, buffer, sizeof(buffer)))
+ if ( (n=write(sigfd, buffer, sizeof(buffer))) < 0)
perror("write on signal fd error");
- else printf("write successfully\n");
+ else
+ printf("write successfully %d bytes\n", n);
}
/* raise signal */
if (raise(SIGINT) != 0)