No es fan servir funcions de rfc*.c ja.
--- a/syslog_in_npipe.c Sun Mar 26 21:12:49 2006 +0200
+++ b/syslog_in_npipe.c Sun Mar 26 23:00:16 2006 +0200
@@ -40,6 +40,7 @@
{
int fd_entrada;
char missatge[MESSAGE_LENGTH];
+ int status;
/* Processem els parĂ metres d'entrada */
if (argn != 2) {
@@ -63,11 +64,22 @@
return 1;
}
- while (readMessage(fd_entrada, missatge) > 0)
+ while ((status = read(fd_entrada, missatge, MESSAGE_LENGTH +1)) > 0)
{
+ /* Dummy */
printf(missatge);
printf("\n");
}
+ if (status < 0)
+ {
+ printf("Error reading the named pipe: %s\n",
+ strerror(errno));
+ close (fd_entrada);
+ return 1;
+ }
+
+ close (fd_entrada);
+
return 0;
}