From: Simone Piccardi Date: Fri, 22 Apr 2011 00:15:29 +0000 (+0000) Subject: Altre correzioni X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=commitdiff_plain;h=65385a77b25d967147a4c7d65930e2edd9bc3d9d;p=gapil.git Altre correzioni --- diff --git a/sources/test_signalfd.c b/sources/test_signalfd.c index cfdcd0b..48a0935 100644 --- a/sources/test_signalfd.c +++ b/sources/test_signalfd.c @@ -53,7 +53,7 @@ int main(int argc, char *argv[]) /* * 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; @@ -104,9 +104,10 @@ int main(int argc, char *argv[]) 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)